Go: // Entrance Examination(入学試験)
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1600&lang=jp
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	for {
		m, nMin, nMax := nextInt(sc), nextInt(sc), nextInt(sc)
		if m == 0 && nMin == 0 && nMax == 0 {
			break
		}

		points := []int{}
		for i := 0; i < m; i++ {
			points = append(points, nextInt(sc))
		}

		gapMax, pass := 0, 0
		for n := nMin; n <= nMax; n++ {
			gap := points[n-1] - points[n]
			if gap >= gapMax {
				gapMax, pass = gap, n
			}
		}

		fmt.Println(pass)
	}
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

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)

Python: while True:
    n,big,small = map(int,input().split(" "))
    if n == 0:
        break
    points = []
    for i in range(n):
        points.append(int(input()))

    results = []
    for i in range(big,small+1):
        results.append(points[i-1] - points[i])

    ameba = len(results)
    for i in range(ameba):
        if results[ameba-1-i] == max(results):
            print(ameba-i+big-1)
            break

Python: while True :
    m, n_min, n_max = map(int, input().split())
    if m == 0 and n_min == 0 and n_max == 0 :
        break
    
    P = list(int(input()) for _ in range(m))
    gap = 0
    for i in range(n_min-1, n_max) :
        x = P[i] - P[i+1]
        if x >= gap :
            gap = x
            n = i
    print(n+1)

Python: da = list(map(int,input().split()))
k = []
while sum(da) != 0:
	for i in range(da[0]):
		k.append(int(input()))
	for i in range(da[0]):
		k[da[0] - 1 -i] = k[da[0] - 1 -i] - k[da[0]-2 -i]


	pp = k[da[1]:da[2]+1]
	qq = min(pp)

	for i in range(len(pp)):
		if pp[i] == qq:
			jj = i

	print(da[1]+jj)

	da = list(map(int,input().split()))
	k = []