Go: /*
	http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1600&lang=jp
	Entrance Examination
*/

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// 標準入力を取得するScannerのインスタンスを作成
var scanner = bufio.NewScanner(os.Stdin)

// 標準入力で各行を読み込みintとして返す

func readLine() int {
	if scanner.Scan() {
		number, _ := strconv.Atoi(scanner.Text())
		return number
	}
	return 0
}

func main() {
	// 改行から空白区切りに変更
	scanner.Split(bufio.ScanWords)

	// 0 0 0の行に到達するまでループする
	for {
		// 合格者、不合格者の境目=ギャップ
		m := readLine()   // 受験者の人数
		min := readLine() // 合格者の最小人数
		max := readLine() // 合格者の最大人数

		// 0 0 0の行に到達したのでループを抜け終了する
		if m == 0 && min == 0 && max == 0 {
			break
		}

		// 得点を格納するsliceを初期化
		ps := make([]int, 0, m)

		// sliceに得点を格納する
		for i := 0; i < m; i++ {
			ps = append(ps, readLine())
		}

		tmp := 0    // ギャップを一時的に保存
		gap := 0    // ギャップの最大値を保存
		answer := 0 // ギャップが最大になった時のindex(合格人数)を保存

		// 合格者の最小人数〜最大人数のギャップを計算する
		for i := min; i <= max; i++ {
			tmp = ps[i-1] - ps[i]

			// ギャップの最大値が更新された場合、最大値と合格人数を更新する
			// ギャップが同じ値だった場合も合格人数を更新する
			// (合格人数が多い方が優先されるので後から現れた値が優先される)
			if tmp >= gap {
				gap = tmp
				answer = i
			}
		}
		fmt.Println(answer)
	}
}

Python: while 1:
    m,nn,nx= map(int,input().split())
    if m==0: break
    s=[int(input()) for _ in range(m)]
    v=k=0
    for i in range(nn-1,nx):
        t=s[i]-s[i+1]
        if v<t:
            k,v=i+1,t
    print(k)

Python: def main():
    while True:
        
        head_d = input()
        head_d = head_d.split(" ")
        for i in range(len(head_d)):
            head_d[i] = int(head_d[i])
        if head_d == [0, 0, 0]:
            return

        s_num = head_d[0]
        n_min = head_d[1]
        n_max = head_d[2]
        s_dat = []

        for i in range(s_num):
            s_dat.append(int(input()))

        answer = showpnum(n_min, n_max, s_dat)
        print(answer)


def showpnum(n_min, n_max, s_dat):
    max_dist = 0
    for i in range(n_max - n_min + 1):
        i = i + n_min - 1
        dist = s_dat[i] - s_dat[i + 1]
        if dist >= max_dist:
            max_dist = dist
            pnum = i + 1

    return pnum
    
main()

Python: while True:
    P = list()
    ans = list()
    tans = list()
    m, Mn, Mx = map(int, input().split())
    if m == 0 and Mn == 0 and Mx == 0:
        break
    for i in range(0, m):
        P.append(int(input()))

    for j in range(Mn-1, Mx, 1):
        ans.append(P[j]-P[j+1])
    print(ans)
    for k in range(0,len(ans)):
        if ans[k] == max(ans):
            tans.append(k)
    print(tans)
    print(max(tans)+Mn)

Python: from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

while True:
    m,nmin,nmax = inpl()
    if m == 0:
        break
    else:
        pp = [int(input()) for _ in range(m)]
        pp.sort(reverse=True)
        ans = 0
        ansgap = -1
        for n in range(nmin,nmax+1):
            gap = pp[n-1] - pp[n]
            if ansgap <= gap:
                ansgap = gap
                ans = n

        print(ans)

Python: while True:
    (m, mn, mx) = tuple(map(int, input().split()))
    if m == 0:
        break
    arr = [0 for i in range(m)]
    for i in range(m):
        arr[i] = int(input())
    arr.sort(reverse=True)
    res = []
    ap = res.append
    for i in range(mn, mx + 1):
        ap([arr[i - 1] - arr[i], i])
    res.sort(key=lambda x: x[0], reverse=True)
    reres = []
    rreap = reres.append
    maxa = res[0][0]
    for e in res:
        if e[0] < maxa:
            break
        rreap(e[1])
    reres.sort(reverse=True)
    print(reres[0])

Python: while True:
    m, n_min, n_max = map(int, input().split())
    if m == 0:
        break
    gap_max = 0
    ans = 0
    pre = int(input())
    for i in range(1, m):
        next = int(input())
        if n_min <= i and n_max >= i:
            tmp = pre - next
            if tmp >= gap_max:
                gap_max = tmp
                ans = i
        pre = next
    print(ans)

Python: while 1:
    a,b,c=map(int,input().split())
    if a==0:break
    d=[int(input()) for i in range(a)]
    e=0
    for i in range(b,c+1):
        if d[i-1]-d[i]>=e:
            e=d[i-1]-d[i]
            f=i
    print(f)

Python: while True :
  m, n, N = map(int, input().split())
  if(m == 0 and n == 0 and N == 0) :
    break
  else :
    p = [0] * m
    for i in range(m) :
      p[i] = int(input())
    s = 0
    for j in range(n - 1, N) :
      if(p[j] - p[j + 1] >= s) :
        s = p[j] - p[j + 1]
        a = j + 1
      else :
        pass
    print(a)

Python: while True:
    num, mini, maxi = map(int, input().split())
    if num == 0: break
    scores = [ int(input()) for i in range(num) ]
    gap = 0
    ans = 0
    for i in range(mini, maxi + 1):
        gap = scores[i-1] - scores[i] if scores[i-1] - scores[i] >= gap else gap
        ans = i if scores[i - 1] - scores[i] >= gap else ans

    print(ans)

Python: while True:
    sa_max = 0
    Sa = []
    num = 0
    Poi_lis = []
    m,nmin,nmax = map(int,input().split())
    if [m,nmin,nmax] == [0,0,0]:
        break
    for i in range(m):
        Poi_lis.append(int(input()))
        if nmin + 1 <= i + 1 <= nmax + 1:
            Sa.append(Poi_lis[i - 1] - Poi_lis[i])
    Sa_r = Sa[::-1]
    
    cou = Sa_r.index(max(Sa_r))
    print(nmin + len(Sa) - cou - 1)

Python: while 1:
    m, nmin, nmax = map(int, input().split())
    if m == 0:
        break

    score = []
    for _ in range(m):
        score.append(int(input()))
    score.sort(reverse=True)

    ans = 0
    num = 0
    for i in range(nmin, nmax+1):
        gap = score[i-1] - score[i]
        if gap >= ans:
            ans = gap
            num = i

    print(num)

Python: while 1:
    m,nn,nx= map(int,input().split())
    if m==0: break
    s=[int(input()) for _ in range(m)]
    v=k=0
    for i in range(nn-1,nx):
        t=s[i]-s[i+1]
        if v<=t:
            k,v=i+1,t
    print(k)

Python: while 1:
    m,nmi,nma=map(int,input().split())
    if not m and not nmi and not nma:break
    l=[int(input()) for _ in range(m)]
    tg=[l[:i][-1]-l[i:][0] for i in range(nmi,nma+1)]
    print(tg.index(max(tg))+nmi)

Python: while True:
  m, nmin, nmax = map(int, input().split())
  if m+nmin+nmax == 0:
    break
  P = [int(input()) for i in range(m)]
  gap = 0
  for i in range(nmin, nmax+1):
    if gap<=P[i-1]-P[i]:
      gap = P[i-1]-P[i]  
      n = i
  print(n)

Python: head = input().split(" ")
while head != "0 0 0":
    num = int(head[0])
    mini = int(head[1])
    maxi = int(head[2]) 

    scores = []

    gaps = []

    for i in range(int(head[0])):
        scores.append(int(input()))
    
    for i in range(mini, maxi):
        oks = scores[:i]
        ngs = scores[i:]
        gap = oks[-1] - ngs[0]
        gaps.append((i,gap))

    filtered = list(filter(lambda x: x[1] == max(gaps), gaps))
    sorted(filtered, lambda x: x[0], True)
    print(filtered[0][0])

Python: while True:
    m, minn, maxn = map(int, input().split())
    if m == minn == maxn == 0:
        break
    P = [int(input()) for i in range(m)]
    ansd = 0
    ansi = 0
    for i in range(minn-1, maxn):
        if P[i] - P[i+1] >= ansd:
            ansd = P[i] - P[i+1]
            ansi = i+1
    print(ansi)

Python: while 1:
  m, n_min, n_max =map(int, input().split())
  if m==0:
    break
  P =[]
  for p in range(m):
    p =int(input())
    P.append(p)
#    d=[int(input()) for i in range(a)]
#  P.sort()
#  print(P)
  
  gap= 0
  x = 0
  for num in range(n_min, n_max+1):
#    print(num-1)
    a = P[num-1]-P[num]
    if a>=gap:
      gap = a
      x = num
      
#  print(gap)
  print(x)