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: ans_list = []

while True:
    m,nmin,nmax = map(int,input().split())
    if (m,nmin,nmax) == (0,0,0):
        break
    P = sorted([int(input()) for _ in range(m)], reverse=True)
    d = -float("inf")
    # 最低点合格者を全探索
    for i in range(nmin-1,nmax):
        res = P[i] - P[i+1]
        if res >= d:
            d = res
            ans = i + 1
    ans_list.append(ans)    

for ans in ans_list:
    print(ans)

Python: while 1:
    m,a,b = map(int, input().split())
    if m==0: break
    p = [int(input()) for i in range(m)]
    key = 0
    ans = 2
    for i in range(a,b+1):
        v = p[i-1]-p[i]
        if v >= key:
            ans = i
            key = v
    print(ans)

Python: def get_input():
    data_list = input().split()
    for i in range(len(data_list)):
        data_list[i] = int(data_list[i])
    return data_list

def get_score_list(student_num):
    score_list = [None] * student_num
    for i in range(student_num):
        score_data = int(input())
        score_list[i] = score_data
    score_list = sorted(score_list, reverse=True)
    return score_list

def decide_success_student_num(score_list, min_num, max_num):
    max_diff = -float('inf')
    for i in range(min_num - 1, max_num):
        tmp_num = score_list[i] - score_list[i+1]
        if tmp_num >= max_diff:
            max_diff = tmp_num
            success_student_num = i + 1
    return success_student_num


if __name__ == "__main__":
    while True:
        student_num, min_num, max_num = get_input()
        if student_num == 0:
            break
        score_list = get_score_list(student_num)
        success_student_num = decide_success_student_num(score_list, min_num, max_num)
        print(success_student_num)

Python: def solve(a,b,c):
    scores = [int(input()) for i in range(a)]
    gap = scores[b-1] - scores[b]
    tmpans = b-1
    for i in range(b-1,c):
        tmpgap = scores[i] - scores[i+1]
        if gap <= tmpgap:
            tmpans = i
            gap = tmpgap
    print(tmpans+1)
while True:
    a,b,c = map(int,input().split())
    if a == b == c and a == 0:
        exit()
    else:
        solve(a,b,c)

Python: while True:
    m, nl, nu = map(int, input().split())
    if m == 0:
        break

    p = [int(input()) for i in range(m)]
    gap = ans = 0
    for n in range(nl, nu + 1):
        if p[n - 1] - p[n] >= gap:
            gap = p[n - 1] - p[n]
            ans = n
    print(ans)

Python: def main():
    while True:
        m,minn,maxn = map(int,input().split())
        if m == 0 and minn == 0 and maxn == 0:
            return
        scores = []
        for _ in range(m):
            p = int(input())
            scores.append(p)
        ans,ansgap = 0,0
        for n in range(minn,maxn+1):
            gap = scores[n-1] - scores[n]
            if gap >= ansgap:
                ansgap = gap
                ans = n
        print(ans)

if __name__ == '__main__':
    main()

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

    scores = []

    gaps = []

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

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

Python: while True:
  m,n1,n2=map(int,input().split())
  if m==0 and n1==0 and n2==0:
    break
  P=[]
  A=[]
  B=[]
  for i in range(m):
    P.append(int(input()))
  
  for i in range(n1,n2+1):
    A.append(P[i-1]-P[i])
    B.append(i)
  S=[]   
  for i in range(len(A)):
    if A[i]==max(A):
      S.append(B[i])
  print(max(S))

Python: j = 0
while 1:
    m,n_min,n_max = map(int,input().split())
    if m == 0 and n_max == 0 and n_min == 0:
        break
    lists = []
    ans_list = []
    max = -999999999999
    for i in range(m):
        point = int(input())
        lists.append(point)
    for i in range(n_min-1,n_max):
        num = lists[i] - lists[i+1]
        if max <= num:
            max = num
            ans = i+1
    print(ans)

Python: from collections import Counter
while True:
    M,NMIN,NMAX = map(int,input().split())
    if M == 0: break
    src = [int(input()) for i in range(M)]
    ctr = Counter(src)
    ctr = list(ctr.items())
    ctr.sort(reverse=True)
    
    n = passed = maxgap = 0
    for (s1,n1),(s2,n2) in zip(ctr, ctr[1:]):
        n += n1
        if n < NMIN: continue
        if n > NMAX: break
        gap = s1-s2
        if gap >= maxgap:
            maxgap = gap
            passed = n
    print(passed)

Python: a=[]
while True:
    m,n_min,n_max=map(int,input().split())
    if m==0 and n_min==0 and n_max==0:
        for i in range(len(a)):
            print(a[i])
        break
    else:
        p=[]
        count=0
        counter=0
        for i in range(m):
            s=int(input())
            p.append(s)
        p=sorted(p,reverse=True)
        for i in range(n_min-1,n_max):
            if counter<=int(p[i])-int(p[i+1]):
                counter=int(p[i])-int(p[i+1])
                count=i+1
        a.append(count)

Python: while True:
    can_n, pass_min, pass_max = [int(i) for i in input().split()]
    if can_n == pass_min == pass_max == 0:
    	break
    	
    score_lst = []
    for _ in range(can_n):
    	score_lst.append(int(input()))
    
    gap_lst = []
    for i in range(pass_min, pass_max + 1):
    	gap_lst.append(score_lst[i - 1] - score_lst[i])
    
    gap_max = max(gap_lst)	
    for i in range(len(gap_lst) - 1, -1, -1):
    	if gap_lst[i] == gap_max:
    		print(i + pass_min)
    		break

Python: while(True):
    try:
        m, n_min, n_max = map(int, input().split())
        Ps = sorted(list(int(input()) for i in range(m)), reverse=True)
        max_v = 0
        ans = 0
        if m == 0:
            break
        for i in range(n_min, n_max+1):
            if i == len(Ps):
                break
            if max_v <= Ps[i-1]-Ps[i]:
                max_v = Ps[i-1]-Ps[i]
                ans = i
        print(ans)
    except:
        break

Python: def main(m, nx, nn):
    b = [int(input()) for i in range(m)]
    d = -1
    for i in range(nn, nx + 1):
        if d <= b[i - 1] - b[i]:
            d = b[i - 1] - b[i]
            ans = i
    print(ans)
while 1:
    m, nmin, nmax = map(int, input().split())
    if m == nmax == nmin == 0:
        break
    main(m,nmax, nmin)