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: for v in range(1000):
  s,t,u = input().split()
  s = int(s)
  t = int(t)
  u = int(u)
  if s == 0:
    break
  else:
    l = []
    m = []
    for i in range(s):
      l.append(int(input()))

    for o in range(s-1):
      w = l[o]-l[o+1]
      w = abs(w)
      m.append(w)

    m = m[t-1:u]
    mx = max(m)
    lll = len(m)
    hhh=-1
    for i in range(lll): 
      if mx==m[i]:
        hhh=i+t
    print(hhh)

Python: while True:
    m,n_min,n_max = list(map(int,input().split()))
    if m == 0:
        break
    v  = [int(input()) for _ in range(m)]
    
    max_gap = 0
    max_index = n_min


    for i in range(n_min,n_max+1):
        gap = v[i-1]-v[i]

        
        if gap > max_gap:
            max_gap = gap
            max_index = i
        elif gap == max_gap:
            max_index = i
            
    
    print(max_index)

Python: answers = []
while True:
    head = input()
    if head == "0 0 0":
        break
    nums = head.split(" ")
    num = int(nums[0])
    mini = int(nums[1])
    maxi = int(nums[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:]
        if len(oks) and len(ngs): 
            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: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**3
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    while True:
        n,ni,na = LI()
        if n == 0:
            break
        a = sorted([I() for _ in range(n)], reverse=True)
        r = 0
        mi = -1
        for i in range(ni, na+1):
            tr = a[i-1] - a[i]
            if r <= tr:
                r = tr
                mi = i
        rr.append(mi)

    return '\n'.join(map(str, rr))


print(main())

Python: 
def solver():
    m, nmin, nmax = map(int, input().split())
    if m == 0 and nmin == 0 and nmax == 0:
        return None
    p = [int(input()) for _ in range(m)]
    ans = 0
    maxdelta = 0
    for a in range(nmin, nmax+1):
        delta = p[a-1] - p[a]
        if delta >= maxdelta:
            maxdelta = delta
            ans = a
    return ans

outputs = []
while True:
    ans = solver()
    if ans == None:
        break
    outputs.append(ans)
print('\n'.join(map(str, outputs)))

Python: import sys


from inspect import currentframe


def pri(*args):
    names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}
    # print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))


def solve(m, n_min, n_max, P):
    ans = n_min
    pri(P)
    gap = P[n_min - 1] - P[n_min]
    pri(gap)

    for i in range(n_min - 1, n_max):
        if gap <= P[i] - P[i+1]:
            gap = P[i] - P[i+1]
            ans = i + 1
            pri(ans)
            pri(gap)
    print(ans)

    return


if __name__ == '__main__':
    while True:
        m_input, n_min_input, n_max_input = map(int, input().split())
        if m_input == n_min_input == n_max_input == 0:
            break
        P_imput = [int(input()) for _ in range(m_input)]

        solve(m_input, n_min_input, n_max_input, P_imput)

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

Python: while True:
    m, n1, n2 = map(int, input().split())
    if m == 0:
        break
    p = [int(input()) for _ in range(m)]
    p.sort(reverse = True)
    g = [p[i] - p[i - 1] for i in range(n1, n2 + 1)]
    print(n2 - g[::-1].index(min(g)))

Python: import sys
while True:
    m, nmin, nmax = [int(i) for i in input().split()]
    if m == 0:
        sys.exit()
    p = [int(input()) for i in range(m)]
    ansnum = 1000000
    ans = 0
    for i in range(nmin-1,nmax):
        if ansnum >= p[i]-p[i+1]:
            ans = i
        ansnum = min(ansnum,p[i]-p[i+1])
    print(ans)

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 = [int(input()) for _ in range(m)]
    ans = [0, 0]
    for i in range(n_min, n_max+1):
        # print("i: {}, P[i-1]: {}, P[i]: {}".format(i, P[i-1], P[i]))
        ans[0] = max(P[i - 1] - P[i], ans[0])
        if ans[0] == P[i - 1] - P[i]:
            ans[1] = i
    print(ans[1])

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

Python: 

while True:
    m,nmi,nma = map(int,input().split())

    if m == 0:
        break

    P = []

    for i in range(m):

        p = int(input())
        P.append(p)


    ans = 0
    ap = 0

    for i in range(m-1):


        if nmi <= i+1 and i+1 <= nma and ans <= P[i]-P[i+1]:

            ans = max(ans,P[i]-P[i+1])
            ap = i+1

    print (ap)

Python: while True:
    ans = [0, 0]
    m, n1, n2 = map(int, input().split())
    if m == n1 == n2 == 0:
        quit()
    p = []
    for i in range(m):
        p.append(int(input()))
    p.sort(reverse=True)
    for i in range(n1 - 1, n2):
        if ans[0] <= p[i] - p[i + 1]:
            ans[0] = p[i] - p[i + 1]
            ans[1] = i + 1
    print(ans[1])