#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int m,mi,ma;
  while(true){
    cin >> m >> mi >> ma;
    if(m==0) break;
    std::vector<int> v;
    for(int i=0;i<m;i++){
      int p;cin >> p;
      v.push_back(p);
    }
    sort(v.begin(),v.end(),greater<int>());
    int gap=-1,n=mi;
    for(int i=mi-1;i<ma;i++){
      int temp=v[i]-v[i+1];
      if(temp>=gap){
        gap=temp;
        n=i+1;
      }
    }
    cout << n << endl;
  }
}
//#pragma GCC optimize(2)
#include<cstdio>
#define L 1<<23
#define C (c=*A++)
#define ENS //__attribute__((optimize("-O2")))
#define NES //__attribute__((optimize("-O2"))) __inline__ __attribute__((always_inline))
#define N 1000001

int MAPLE,n,l[N],r[N],cnt,last,wt,ss[19];char fl[L],*A=fl,s[N],t[N];bool fg=true;
NES void read(int&x){char c;for(x=0;'0'>C||c>'9';);while('0'<=c&&c<='9')x=(x<<3)+(x<<1)+c-48,C;}NES void print(int x){if(!x)putchar(48);else{for(wt=0;x;ss[++wt]=x%10,x/=10);for(;wt;putchar(ss[wt--]+48));}}
ENS int main()
{int i,j;char c;
	for(fl[fread(fl,1,L,stdin)]=EOF,read(n);'a'>C||c>'z';);for(i=1;i<=n;s[i]=c,C,i++);while('a'>C||c>'z');for(i=1;i<=n;t[i]=c,C,i++);
	for(last=i=n,j=n+1;i;fg&=s[i]==t[i],i--)
		if(t[i]!=t[i-1])
		{if((--j)>i)j=i;
			for(;j&&s[j]!=t[i];j--);if(!j)return puts("-1"),0;
			l[++cnt]=j,r[cnt]=last,last=i-1;
		}if(fg)return puts("0"),0;for(l[0]=n+1,i=1;i<=cnt;i++)for(;l[i-MAPLE]<r[i]+MAPLE;MAPLE++);print(MAPLE);
}