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++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
using namespace std;

int main() {
	
	while(true){
		int m, nmin, nmax;
		cin >> m >> nmin >> nmax;
		
		if(m == 0){
			break;
		}
		
		int a[1000];
		
		for(int i = 0; i < m; i++){
			cin >> a[i];
		}
		
		int mm = 0;
		int ans = 0;
		
		for(int i = nmin; i <= nmax; i++){
			if(a[i - 1] - a[i] >= mm){
				mm = a[i - 1] - a[i];
				ans = i;
			}
		}
		
		cout << ans << endl;
		
	}
	return 0;
}

C++: #include <iostream>
#include <vector>

using namespace std;

int main(void) {
	vector<int> result(0);
	int m;
	int nMin;
	int nMax;
	cin >> m;
	cin >> nMin;
	cin >> nMax;
	while (m != 0 || nMin != 0 || nMax != 0) {
		vector<int> array(0);
		for (int i = 0; i < m; i++) {
			int p;
			cin >> p;
			array.push_back(p);
		}
		int tmp = -1;
		int diffMax = -10000;
		for (int i = nMin - 1; i < nMax; i++) {
			int diff = array[i] - array[i + 1];
			if (diff >= diffMax) {
				diffMax = diff;
				tmp = i + 1;
			}
		}
		result.push_back(tmp);
		cin >> m;
		cin >> nMin;
		cin >> nMax;
	}
	
	for (int &num:result) {
		cout << num << endl;
	}
	
	return 0;
}

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

int main()
{
    vector<int> ans;
    while (1)
    {
        int m, min, max;
        cin >> m >> min >> max;
        if (m + min + max == 0)
        {
            break;
        }

        vector<int> scoreList;
        for (int i = 0; i < m; ++i)
        {
            int input;
            cin >> input;
            scoreList.push_back(input);
        }

        int maxDif = 0, answer = min;
        for (int i = min; i <= max; ++i)
        {
            int dif = scoreList[i - 1] - scoreList[i];

            if (dif >= maxDif)
            {
                maxDif = dif;
                answer = i;
            }
        }

        ans.push_back(answer);
    }

    for (int i = 0; i < ans.size(); ++i)
    {
        cout << ans[i] << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
const double eps=1e-9;
typedef vector<int> vi;
typedef long long ll;
int m,nmn,nmx;
int gap=0;
int p[10005];
int main(void)
{
  while(cin >> m >> nmn >> nmx && m)
    {
      int ans;
      gap=0;
      for(int i=1;i<=m;i++)
	{
	  cin >> p[i];
	}
      for(int i=nmn;i<=nmx;i++)
	{
	  int tmp;
	  tmp=p[i]-p[i+1];
	  if(tmp>=gap)
	    {
	      gap=tmp;
	      ans=i;
	    }
	}
      cout << ans << endl;
    }
  return 0;
}

C++: #include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>

int testcase_ends() {
  size_t m;
  size_t nmin, nmax;
  scanf("%zu %zu %zu", &m, &nmin, &nmax);

  if (m == 0 && nmin == 0 && nmax == 0) return 1;

  std::vector<int> P(m);
  for (auto& pi: P) scanf("%d", &pi);

  std::sort(P.rbegin(), P.rend());
  size_t res = 0;
  int gap = 0;
  for (size_t i = m; i--;) {
    if (i > nmax) continue;
    if (i < nmin) break;
    if (gap < P[i-1]-P[i]) {
      gap = P[i-1]-P[i];
      res = i;
    }
  }
  printf("%zu\n", res);
  return 0;
}

int main() {
  while (!testcase_ends()) {}
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,a,b;
ll i,j,k;
ll x[100005];

bool solve(){
	cin >> n >> a >> b;
	if(n + a + b == 0){
		return false;
	}
	for(i=0;i<n;i++){
		cin >> x[i];
	}
	ll num = -100;;
	ll ansind = -1;
	for(i=a-1;i<b;i++){
		ll sa = x[i] - x[i+1];
		if(sa >= num){
			num = sa;
			ansind = i;
		}
	}
	cout << ansind + 1<< endl;
	return true;
}


int main(){
	while(solve());
	return 0;
	
}

C++: #include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

#define reps(i,f,n) for(int i=f; i<n; ++i)
#define rep(i,n) reps(i,0,n)

int main()
{
    int m, a, b;
    
    while(cin >> m >> a >> b, m){
        vector<int> pt(m);
        for(int i=0; i<m; ++i){
            cin >> pt[i];
        }
        
        pair<int, int> ans{-1, -1};
        
        rep(p, 10000){
            vector<int> ok, ng;
            
            rep(i, m){
                if(pt[i] < p) ng.push_back(pt[i]);
                else ok.push_back(pt[i]);
            }
            
            int n = ok.size();
            if(a <= n && n <= b){
                int gap = *min_element(ok.begin(), ok.end()) - *max_element(ng.begin(), ng.end());
                ans = max(ans, {gap, ok.size()});
            }
        }
        
        cout << ans.second << endl;
    }
}

C++: #include <bits/stdc++.h> // {{{
// clang-format off
#define ARG4(_1, _2, _3, _4, ...) _4
#define rep(...) ARG4(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define REP(i, a) FOR(i, 0, a)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(...) ARG4(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define RREP(i, a) RFOR(i, 0, a)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (int)(a); --i)
#define ALL(c) (c).begin(), (c).end()
#define TEN(n) ((ll)(1e##n))
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define USE1(T) template <typename T> inline
#define USE2(T, U) template <typename T, typename U> inline
#define mygc(c) (c) = getchar_unlocked()
#define mypc(c) putchar_unlocked(c)
 
template<typename T> using vec = std::vector<T>;
template<typename T> using withi = std::pair<T, int>;
using ll = long long;
USE2(T,U)bool chmax(T&x,U a){return x<a&&(x=a,1);}
USE2(T,U)bool chmin(T&x,U a){return a<x&&(x=a,1);}
USE1(T=int)T in(){T x;std::cin>>x;return x;}
USE1(T=int)vec<T>in(int n){vec<T>v;v.reserve(n);rep(i,n)v.pb(in<T>());return v;}
USE2(T,U=withi<T>)vec<U>zipi(const vec<T>&x,int s=0){int N=x.size();vec<U>v;v.reserve(N);rep(i,N)v.pb(x[i],s+i);return v;}
USE1(T)vec<T>ndvec(T v,int n){return vec<T>(n,v);}
USE2(T,...Ts)auto ndvec(T v,int n,Ts...ns)->vec<decltype(ndvec(v,ns...))>{return ndvec(ndvec(v,ns...),n);}
USE1(T)void pr(T x){std::cout<<x<<'\n';}
USE2(T,...Ts)void pr(T x,Ts...xs){std::cout<<x<<' ';pr(xs...);}
USE1(T=int)T rd(){T x=0,m=0,k;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||'9'<k)break;x=x*10+k-'0';}return x;}
USE1(T=int)void wr(T x,char c='\n'){int s=0,m=0;char b[32];if(x<0)m=1,x=-x;for(;x;x/=10)b[s++]=x%10;if(!s)b[s++]=0;if(m)mypc('-');for(;s--;)mypc(b[s]+'0');mypc(c);}
// clang-format on
// }}}
struct IoSetup { // {{{
  IoSetup() {
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.precision(10);
    std::cerr.precision(10);
  }
} iosetup; //}}}
using namespace std;
const int inf = 1001001001;
const ll infl = 1001001001001001001ll;
const int dd[] = {0, 1, 0, -1, 0};

signed main() {
  int M, mi, ma;
  while (M = in(), mi = in(), ma = in(), M || mi || ma) {
    auto P = in(M);
    int gap = 0;
    int ans = 0;
    for (int border : P) {
      int lo = inf, hi = -inf;
      int pass = 0;
      for (int p : P) {
        if (border <= p) {
          pass++;
          chmin(lo, p);
        } else {
          chmax(hi, p);
        }
      }
      int g = lo - hi;
      if (mi <= pass && pass <= ma) {
        if (chmax(gap, g) || g == gap) chmax(ans, pass);
      }
    }
    pr(ans);
  }

  return 0;
}