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 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)

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)