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: N = input().split(" ")
a = [input() for i in range(int(N[0]))]
ma =int(N[2])
mi =int(N[1])
gap = []
x = mi
while x != ma + 1:
   value = int(a[x - 1]) - int(a[x])
   gap.append(value)
   x = x + 1
import numpy as np
gapIndex = np.array(gap)
maxIndex = [i for i, x in enumerate(gapIndex) if x == max(gapIndex)]
print(int(maxIndex[0]) + 2)

Python: anslist = []

while True:
    m, nmin, mmax = map(int, input().split())
    if m == 0 and nmin == 0 and mmax == 0:
        break
    p = [int(input()) for i in range(m)]
    p.sort()

    ans = 0
    line = 0
    for i in range(m - mmax, m - nmin + 1):
        if ans < p[i] - p[i - 1]:
            ans = p[i] - p[i - 1]
            line = i
    #print(line)
    anslist.append(m - line)

for i in anslist:
    print(i)

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 = [0 for i in range(m)]
    for i in range(m):
        P[i] = int(input())
    
    P.sort()
    ans = 0
    ans_gap = 0
    prev = P[m - n_max - 1] 
    
    for i in range(m - n_max, m - n_min + 1):
        if P[i] != prev:
            if ans_gap < (P[i] - P[i - 1]):
                ans_gap = P[i] - P[i - 1]
                ans = m - i
        prev = P[i]
    
    print(ans)

Python: def solve():
    m, mn, mx = map(int, input().split())
    if m == 0 and mn == 0 and mx == 0:
        return False

    p = [int(input()) for x in range(m)]

    result, ans = 0, 0

    for i in range(mn, mx + 1):
        if p[i - 1] - p[i] >= result:
            result = p[i - 1] - p[i]
            ans = i
    print(ans)
    return True

while solve(): pass

Python: while 1:
    m,n_min,n_max = map(int,input().split())
    if m == 0 and n_min == 0 and n_max == 0:
        break
    p  = [int(input()) for i in range(m)]
    p.sort()
    p.reverse()
    lists = list(range(n_min,n_max+1))
    ans = []
    Max = -9999999999
    ans = -9999999999
    for i in lists:
        if Max <= abs(p[i-1]-p[i]):
            Max = abs(p[i-1] - p[i])
            ans = max(ans,i)
    print(ans)

Python: def solve(m,na,nb):
	p = [int(input()) for i in range(m)]
	ans,gap = -1,0
	for i in range(na,nb + 1):
		if p[i - 1] - p[i] >= gap:
			gap = p[i - 1] - p[i]
			ans = i
	print(ans)
	

while True:
	m,na,nb = map(int,input().split())
	if m == 0: break
	solve(m,na,nb)

Python: while True:
    m, n_min, n_max = map(int, input().split())
    if m == 0:
        break
    p = [int(input()) for _ in range(m)]
    ans = tmp = 0
    for i in range(n_min, n_max+1):
        hoge = p[i-1] - p[i]
        if tmp <= hoge:
            tmp = hoge
            ans = i
    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: 10 * x[0] + x[1], reverse=True)
    print(res[0][1])

Python: answers = []
while True:
    head = input()
    if head == "0 0 0":
        break
    nums = head.split(" ")
    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])
    answers.append(filtered[-1][0])

for i in answers:
    print(i)

Python: while True:
    m,ni,na = map(int,input().split())
    if m+na+ni == 0:
        break
    P = [int(input()) for _ in range(m)]
    P.sort(reverse=True)
    m = 0
    ans = 0
    for i in range(ni-1, na):
        if m <= abs(P[i]-P[i+1]):
            m = abs(P[i]-P[i+1])
            ans = i+1
    print(ans)

Python: #1600_入学試験
#1行目：（m, nmin, nmax) [(データ個数, 合格者最小人数, 合格者最大人数)]
#合格者数 n は nmin 人以上，nmax 人以下とする． n はこの範囲内でギャップを最大とするものでなくてはいけない． 
#ギャップとは合格者の最低点と不合格者の最高点の差
#同じギャップになる n が複数あるときは，その中で n が最大になるように選ぶ．


while True :

  m, nmin, nmax = map(int,input().split())
  #もしm=0ならbreak
  if m == 0:
    break
  else:
    #配列n[i]を読み込む(1<=i<=n)
    n = [int(input()) for i in range(m)]
    
    gap = 0
    cnt = 0
    
    for i in range(nmax, nmin-1,-1) :
      #iのときのギャップを求める
      if (abs(n[i]- n[i-1])) > gap :
        
        gap =  abs(n[i] - n[i-1])
        cnt = i
        
        
        
    
    print(cnt)

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: if __name__ == "__main__":
    while 1:
        m,nmin,nmax = list(map(int,input().strip().split()))
        if m == nmin == nmax ==0:break
        points = []
        for _ in range(m):points.append(int(input()))
        ans = 0
        diff = 0
        for i in range(nmin,nmax+1):
            if diff < points[i-1] - points[i]:
                ans = i
                diff = points[i-1] - points[i]
            elif diff == points[i-1] -points[i] and i > ans :ans =i
        print(ans)

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(nma-tg[::-1].index(max(tg)))

Python: while True:
    m, n_min, n_max = map(int, input().split())
    if m == n_min == n_max == 0:
        break
    prev = int(input())
    diff = [0] * m
    mx = 0

    for i in range(1, m):
        now = int(input())
        diff[i] = prev - now
        prev = now

    ans = 0
    for i in range(n_min, n_max + 1):
        if mx <= diff[i]:
            ans = i
            mx = diff[i]

    print(ans)

Python: while True:
    m, n_min, n_max = map(int, input().split())
    if (m+n_min+n_max) == 0:
        break
    else:
        score = []
        before = 0
        dif = 0
        num = 0
        for i in range(1, m+1):
            s = int(input())
            if n_min+1 <= i <= n_max+1:
                if before - s >= dif:
                    num = i - 1
                    dif = before - s
            before = s
        print(num)