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++: // Template {{{
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
typedef long long LL;

#ifdef LOCAL
#include "contest.h"
#else
#define error(args...) 
#endif

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
inline bool valid(int x, int w) { return 0 <= x && x < w; }

void iostream_init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(12);
}
//}}}

int main(){
    iostream_init();
    int m, n1, n2;
    while(cin >> m >> n1 >> n2 && m != 0) {
    vector<int> P(m);
    REP(i, m) cin >> P[i];
    int max_diff = -1;
    int ans = -1;
    for(int i = n1; i <= n2; i++) {
        int diff = P[i-1] - P[i];
        if(diff >= max_diff) {
            max_diff = diff;
            ans = i;
        }
    }
    cout << ans << endl;
    }
    return 0;
}

C++: #include"bits/stdc++.h"

#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}


void solve();

int main() {

	solve();
	return 0;

}

void solve() {

	ll m, n_min, n_max;
	vector<ll> s;



	cin >> m >> n_min >> n_max;

	while (m > 0) {
		ll gap = 0, ans = 0;
		s.resize(m);
		REP(i, m) {

			cin >> s[i];

		}

		FOR(i, n_min-1, n_max ) {

			if (s[i] - s[i + 1] >= gap) {

				ans = i+1;
				gap = s[i] - s[i + 1];

			}

		}

		cout << ans << endl;

	}

}

C++: #include<stdio.h>
#include<stdlib.h>
int main(void){
    int n,N,m,i,j,k=0;
    int p[10000];
    int *answer;

    while(1){
    scanf("%d %d %d",&m,&n,&N);
    if(m==0){
        break;
    }
    for(i=0;i<m;i++){
        scanf("%d",&p[i]);
    }
   int temp=0;
   int q;
    for(i=n;i<=N;i++){
        int a=p[i-1]-p[i];
        if(temp<=a){
            temp=a;
            q=i;
        }
    }
    answer[k]=q;
    k++;
    }
    for(j=0;j<k;j++){
    printf("%d\n",answer[j]);
    }
return 0;
}

C++: #include<iostream>

using namespace std;
const int MAX_N=1e3;
int data[MAX_N];
int main(){
	int m,nmi,nma;
	while(cin>>m>>nmi>>nma && nmi!=0){
		for(int i=0;i<m;i++)cin>>data[i];
		int ma=0;
		int ans=0;
		for(int i=nmi-1;i<nma;i++){
			if(ma<=data[i]-data[i+1]){
				ans=i+1;
				ma=data[i]-data[i+1];
			}
		}
		cout<<ans<<endl;
	}
}

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

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF = 1e9;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

int main()
{
    int M, NA, NB;
    while (cin >> M >> NA >> NB, M || NA || NB) {
        vector<int> P(M);
        rep(i, M) {
            cin >> P[i];
        } 

        int ans = 0, mgap = 0;
        for (int i=NA; i<=NB; i++) {
            int gap = P[i-1] - P[i];
            if (gap >= mgap) {
                ans = i;
                mgap = gap;
            }
        }

        cout << ans << endl;
    }
}

C++: hoge

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

int main(){

    while(1){

    int n,ma,mi; cin>>n>>mi>>ma;

    if(n == 0 & ma == 0 && mi == 0) break;

    vector<int> sco(n);

    for(int i=0; i<n; i++){

        cin>>sco[i];

    }

    int ans=0,gap=0;

    for(int i=mi; i<=ma; i++){

        if(sco[i-1] - sco[i] >= gap){

            gap = sco[i-1] - sco[i];

            ans = i;
        }
    }

    cout<<ans<<endl;
   
    }

    return 0;
}

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

int main(void){
  int m, nmin, nmax;
  int gap, ans, lower, p, i;
  while(1){
    cin >> m >> nmin >> nmax;
    if(m == 0) break;

    for(i=0;i<nmin - 1;i++) cin >> p;
    cin >> lower;
  
    ans = nmin;
    gap = 0;
    for(i=0;i<nmax - nmin + 1;i++){
      cin >> p;
      if(gap <= lower - p){
        gap = lower - p;
        ans = nmin + i;
      }
      lower = p;
    }
  
    for(i=0;i<m - nmax - 1;i++) cin >> p;

    cout << ans << endl;
  }
  return 0;
}

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

int main(){
	while(1){
		int m,nmin,nmax;
		cin>>m>>nmin>>nmax;
		if(m==0)
			break;
		int gap=0;
		int n=0;
		int P[200];
		for(int i=0;i<m;i++){
			cin>>P[i];
		}
		for(int i=nmin-1;i<nmax-1;i++){
			if(P[i]-P[i+1]>=gap){
				gap=P[i]-P[i+1];
				n=i;
			}
		}
		cout<<n<<endl;
		
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void) {
	int m, n_min, n_max;
	int score[205], gap, ans;

	while (1) {
		cin >> m >> n_min >> n_max;
		if (m == 0 && n_min == 0 && n_max == 0) break;

		gap = 0; ans = 0;
		for (int i = 1; i <= m; i++) {
			cin >> score[i];
		}
		for (int j = n_min; j <= n_max; j++) {
			if (score[j] - score[j + 1] >= gap) {
				gap = score[j] - score[j+1];
				ans = j;
			}
		}
		cout << ans << endl;
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
#define REP(i,n) for(int i=0;i<int(n);i++)

int main()
{
  while(1){
    int m, n_min, n_max;
    cin >> m >> n_min >> n_max;
    if(m == 0 && n_min == 0 && n_max == 0) break;
    int P[m];
    REP(i,m) cin >> P[i];
    int ans;
    int gap = 0;
    for(int i = n_min; i <= n_max; i++)
      if(P[i-1]-P[i] >= gap){
        gap = P[i-1]-P[i];
        ans = i;
      }
    cout << ans << endl;
  }
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	int n,m,k;
	while(cin>>n>>m>>k,n){
		vi a(n);
		rep(i,n)cin>>a[i];
		sort(all(a),[](int a,int b){return a>b;});
		int out=0;
		int outa=0;
		loop(i,m,k+1){
			int t=a[i-1]-a[i];
			if(out<=t){
				out=t;
				outa=i;
			}
		}
		cout<<outa<<endl;
	}
}