Go: package main

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

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

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
		}

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

		// 最低合格者数と最高合格者数の間の各得点間のギャップが最大になる合格者数を取得する
		scoreGap := 0
		scoreGapMax := 0
		qualifiedNum := 0
		for n := nMin; n <= nMax; n++ {
			scoreGap = score_list[n-1] - score_list[n]
			if scoreGap >= scoreGapMax {
				scoreGapMax = scoreGap
				qualifiedNum = n
			}
		}

		fmt.Println(qualifiedNum)
	}
}

C++: #pragma region _head

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>
#include<regex>

void Init() {
	std::cin.tie(0); std::ios::sync_with_stdio(false);
	struct Init_caller { Init_caller() { Init(); } }caller;
}

#pragma region _define

#define int LL
#define f(i,a,b) for(LL i=a;i<b;i++)
#define rep(i,n) for(LL i=0;i<n;i++)
#define rep2(i,j,a,h,w) for(LL i=0;i<h;i++)for(LL j=0;j<w;j++)cin>>a[i][j]
#define f_vI(v,n) f(i,0,n)cin>>v[i]
#define f_v2I(v1,v2,n) f(i,0,n)cin>>v1[i]>>v2[i]
#define f_v3I(v1,v2,v3,n) f(i,0,n)cin>>v1[i]>>v2[i]>>v3[i]
#define f_vO(v,n) f(i,0,n)cout<<v[i]<<endl
#define ei else if
#define all(a) a.begin(),a.end()
#define size(s) ((LL)s.size())
#define F first
#define S second
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl
#define INT_INF 1<<29
#define LL_INF 1LL<<60
#define MOD 1000000007

#pragma endregion





#pragma region _using

using namespace std;

using LL = long long;
using st = string;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<int>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<int>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<int, int>;
using ppi = pair<pi, int>;
using mll = map<int, int>;
using mcl = map<char, int>;
using msb = map<st, bool>;
using vpi = vector<pi>;
using vppi = vector<ppi>;
using qpi = queue<pi>;

#pragma endregion

//十字移動のみ
int cross_x[] = { -1,0,0,1 };
int cross_y[] = { 0,1,-1,0 };



void y_n(bool p) {
	p ? _y() : _n();
}

void Y_N(bool p) {
	p ? _Y() : _N();
}

LL vmax(vi v, LL n) {
	int MAX = 0;
	f(i, 0, n) {
		MAX = max(MAX, v[i]);
	}
	return MAX;
}

LL vmin(vi v, LL n) {
	int MIN = LL_INF;
	f(i, 0, n) {
		MIN = min(MIN, v[i]);
	}
	return MIN;
}

LL gcd(LL a, LL b) {
	if (b == 0) {
		swap(a, b);
	}
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b) * b);
}

//素数判定
bool is_prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			return false;
		}
	}
	return true;
}


//素因数分解
void dec_prime(int n) {
	int a = 2;
	while (a*a <= n) {
		if (n % a == 0) {
			cout << a << endl;
			n /= a;
		}
		else {
			a++;
		}
	}
	cout << n << endl;
}

//エラトステネスの篩
void sieve_prime(LL n) {
	vb s(n + 1, true);
	f(i, 2, n + 1) {
		for (int j = 2; i*j <= n; j++) {
			s[i*j] = false;
		}
	}
	cout << "2から" << n << "までの素数" << endl;
	f(i, 2, n + 1) {
		if (s[i]) {
			cout << i << " ";
		}
	}
}

//階乗計算
LL factorial(LL n) {
	LL a = 1, ret = 1;
	while (a < n) {
		a++;
		ret *= a;
		//ret %= MOD;
	}
	return ret;
}


#pragma endregion 

vi par;

int root(int x) {
	if (par[x] == x) {
		return x;
	}
	else {
		return par[x] = root(par[x]);
	}
}

void unite(int x, int y) {
	if (root(x) == root(y)) {
		return;
	}
	else {
		par[root(x)] = root(y);
		return;
	}
}

bool same(int x, int y) {
	return root(x) == root(y);
}

struct edge {
	int to;
	int cost;
};

/*****************************************************************************/
signed main() {

	while (1) {
		int m, n, N;
		cin >> m >> n >> N;
		if (m == 0 && n == 0 && N == 0) {
			break;
		}
		vi p(m);
		rep(i, m) {
			cin >> p[i];
		}
		int d = -1;
		int memo;
		for (int i = n; i <= N; i++) {
			if (d <= p[i - 1] - p[i]) {
				d = p[i - 1] - p[i];
				memo = i;
			}
		}
		cout << memo << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;


int main(){
    int m,n_min,n_max;

    while(cin>>m>>n_min>>n_max,m){
        vector<int> V(m);
        for(int i=0;i<m;i++) cin>>V[i];
        sort(V.begin(), V.end(),greater<int>());
        int ans=-1;
        int gap=0;
        for(int i=n_min-1;i<n_max;i++){
            if(V[i+1]==V[i]) continue;
            if(V[i]-V[i+1]>=gap){
                gap=V[i]-V[i+1];
                ans=i+1;
            }
        }
        cout<<ans<<endl;
    }

    return 0;
}

C++: // 1600_EntranceExamination.cpp
//
#include <bits/stdc++.h>
using namespace std;
int m, nmin, nmax, res, dif;
int p[10010];
int main() {
  while(cin >> m >> nmin >> nmax && m && nmin && nmax) {
    dif = 0;
    for(int i = 0; i < m; ++i) {
      cin >> p[i];
      if(nmin <= i && i <= nmax && dif <= p[i-1] - p[i]) {
        res = i;
        dif = p[i-1] - p[i];
      }
    }
    cout << res << endl;
  }

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  while(1){
    int m,n1,n2,a[200],max=0,maxn;
    cin>>m>>n1>>n2;
    if(m+n1+n2==0)break;
    for(int i=0;i<m;i++)cin>>a[i];
    for(int i=n1;i<=n2;i++){
      int b=a[i-1]-a[i];
      if(max<=b)max=b,maxn=i;
    }
    cout<<maxn<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
	while (true) {
		int m,nmin,nmax;
		cin>>m>>nmin>>nmax;

		if (m==0&&&nmin==0&&nmax==0) break;

		int P[200];
		for (int i = 0; i < m; i++) {
			cin>>P[i];
		}

		int gap=-1;
		int n=-1;

		for (int i = nmin; i < nmax; i++) {
			int g=P[i-1]-P[i];

			if(gap<=g){
				gap=g;
				n=i;
			}
		}
		cout<<n<<endl;
	}
	return 0;
}

C++: /*  -*- coding: utf-8 -*-
 *
 * 1600.cc: Entrance Examination
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_M = 200;

/* typedef */

/* global variables */

int ps[MAX_M];

/* subroutines */

/* main */

int main() {
  for (;;) {
    int m, nmin, nmax;
    scanf("%d%d%d", &m, &nmin, &nmax);
    if (m == 0) break;

    for (int i = 0; i < m; i++) scanf("%d", ps + i);

    int maxg = -1, n = -1;
    for (int i = nmax; i >= nmin; i--) {
      int g = ps[i - 1] - ps[i];
      if (maxg < g) maxg = g, n = i;
    }

    printf("%d\n", n);
  }
  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<queue>
#include<vector>
using namespace std;

int main()
{
	while (1)
	{
		priority_queue<int> GAP;
		priority_queue<int> PQ;
		int m, n_min, n_max;
		scanf("%d%d%d", &m, &n_min, &n_max);
		if (m == 0)break;
		for (int i = 0; i < m; i++)
		{
			int k;
			scanf("%d", &k);
			PQ.push(k);
		}
		int index = 0;
		for (int i = n_min; i <= n_max; i++)
		{
			priority_queue<int> tPQ = PQ;
			for (int l = 0; l < i-1; l++)
			{
				tPQ.pop();
			}
			int temp = tPQ.top();
			tPQ.pop();
			int gap = temp - tPQ.top();
			GAP.push(gap);
			if (gap == GAP.top())index = i;
		}
		printf("%d\n",index);
	}
	return 0;
}