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

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;
const int INF=1<<23;

int main() {
    ll n,a,b;
    while(true){
        cin>>n>>a>>b;
        if(n+a+b==0)break;
        vector<ll> v(n);
        rep(i,n){
            cin>>v[i];
        }
        sort(v.rbegin(),v.rend());
        ll gap=0;ll ans=0;
        for(ll i=a;i<=b;i++){
            ll g=v[i-1]-v[i];
            if(gap<=g){
                gap=g;
                ans=i;
            }
        }
        cout<<ans<<endl;
    }

    return 0;
}

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

int main() {
	int m,min,max,ten[200],gap=10001,sa;
	
	cin>>m>>min>>max;
	
	while(1){
		if(m==0 && min==0 && max==0){
			break;
		}
	    for(int i=1;i<=m;i++){
    		cin>>ten[i];
    	}
    	for(int i=min;i<=max;i++){
    		if(gap>=ten[i+1]-ten[i]){
	    		gap=ten[i+1]-ten[i];
    			sa=i;
	    	}
	    }
    	cout<<sa<<endl;
    	gap=10001;
    	sa=0;
	    cin>>m>>min>>max;
	}

	
	return 0;
}

C++: #include<cstdio>

int main() {
	while (1) {
		int m, nmin, nmax, p[201], maxg = 0, n;
		scanf("%d %d %d", &m, &nmin, &nmax);
		for (int i = 1; i <= m; i++) {
			scanf("%d", &p[i]);
		}
		for (int j = nmin; j <= nmax; j++) {
			if (p[j] - p[j+1] >= maxg) {
				maxg = p[j] - p[j+1];
				n = j;
			}
		}
		if (m == 0 && nmin == 0 && nmax == 0) {
			return 0;
		}
		else {
			printf("%d\n", n);
		}
	}
}

C++: #include <bits/stdc++.h>
#define ll long long
#define all(a) (a).begin(),(a).end()

int main(int argc, char const *argv[]) {
  while(1){
    ll m=0,nmin=0,nmax=0;
    scanf("%lld%lld%lld",&m,&nmin,&nmax);
    if(m==0 && nmin==0 && nmax==0){
      break;
    }
    std::vector<ll> p(m);
    for (size_t i = 1; i <= m; i++) {
      scanf("%lld",&p[i]);
    }
    ll temp=0,memo=0,memoid=0;
    for (size_t i = nmin; i <= nmax; i++) {
      temp=p[i]-p[i+1];
      memo=std::max(memo,temp);
      if(memo==temp) memoid=i;
    }
    printf("%lld\n",memoid);
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>
#include <math.h>

using namespace std;

int main (void)
{
	int m,min,max,p[100],g[100],kkk,rrr;

	for (int o = 0; o < 100; o++)
	{
	cin >> m >> min >> max;

	if (m == 0 && min == 0)
	{
		if (max == 0)
		{
			break;
		}
	}

	kkk = 0;

	for (int i = 1; i < m + 1; i++)
	{
		cin >> p[i];
	}

	for (int j = min; j < max + 1; j++)
	{
		g[j] = p[j] - p[j + 1];

		if (kkk <= g[j])
		{
			kkk = 0;
			kkk = g[j];
			rrr = 0;
			rrr = j;
		}
	}

		cout << rrr << endl;
	}
}

C++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <map>
# include <stack>
using namespace std;
//# define M_PI 3.141592
# define INF ((int)(1<<30))
# define FOR(i,n) for(int i=0;i<(int)n;i++)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define toRad 2.0*M_PI/360.0
# define inin(x) int x;cin>>x;
# define all(x) x.begin(),x.end()
# define debug(x) cout<<#x<<" :"<<x<<endl;
# define rep(i,n) for(int i=0;i<(int)n;i++)
# define EPS 1e-12
# define CHECK(i,a) FOR(i,a.size())cout<<#a<<"["<<i<<"] : "<<a[i]<<endl; 
typedef vector<int> vi;


int main()
{
	int m, n1, n2;
	while (cin >> m >> n1 >> n2&&m)
	{
		vi a;
		FOR(i, m)
		{
			inin(x);
			a.push_back(x);
		}
		sort(a.rbegin(), a.rend());

		int g = -1, ans;
		for (int i = n1-1; i < n2;i++)
		{
			if (a[i]- a[i+1] >= g)
			{
				g = a[i] - a[i+1];
				ans = i+1;
			}
		}
		cout << ans << endl;
	}
}

C++: #include <bits/stdc++.h>
#define rep(i,j) for (int (i)=0;(i)<(int)(j);++(i))
#define put(i) cout << (i) << endl
using namespace std;
typedef long long ll;

int main() {
    int m, nmin, nmax;
    while (cin >> m >> nmin >> nmax, (m||nmin||nmax)) {
        vector<int> p(m);
        rep(i,m) cin >> p[i];
        sort(p.begin(), p.end(), [](const int & a, const int & b) {return a > b;});
        int ans = -1, v = -1;
        for (int i = nmin-1; i < nmax; ++i) {
            int gap = p[i]-p[i+1];
            if (gap >= v) {
                v = gap;
                ans = i+1;
            }
        }
        put(ans);
    }
}

C++: #include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	ll m, nmin, nmax;
	while(cin>>m>>nmin>>nmax, m!=0){
		vll p(m);
		ll gap=-1, ans=-1;
		rep(i, m) cin >> p[i];
		sort(rall(p));
		for(int i=nmin; i<=nmax; i++){
			int diff = p[i-1]-p[i];
			if (gap <= diff){
				gap = diff;
				ans = i;
			}
		}
		cout << ans << "\n";
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	for (int a, b, c; cin >> a >> b >> c&&a;) {
		vector<int> P(a); rep(i, 0, a) { cin >> P[i]; }
		int g = INF;
		int ans = 0;
		rep(i, 1, a) {
			if (i >= b&&i <= c) {
				if (g >= P[i] - P[i - 1]) {
					g = P[i] - P[i - 1];
					ans = i;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}