#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	int N, M;

	while(cin >> N >> M, N || M) {
		vector<int> P;
		vector<int> v;
		for(int i = 0; i < N; i++) {
			int tmp;
			cin >> tmp;
			P.push_back(tmp);
		}
		P.push_back(0);

		for(int i = 0; i < P.size(); i++) {
			for(int j = 0; j < P.size(); j++) {
				v.push_back(P[i]+P[j]);
			}
		}
		sort(v.begin(), v.end());
		int j = v.size() - 1;
		int res = 0;
		for(int i = 0; i < v.size(); i++) {
			while(v[i]+v[j] > M && j >= 0)
				j--;
			if(j >= 0)
				res = max(res, v[i] + v[j]);
		}
		cout << res << endl;
	}
}
#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
 
typedef long long ll;
typedef pair<int, int> ii;

int main() {

	int m, nmin, nmax;
	while(cin >> m >> nmin >> nmax, m){
		vector<int> p(m);
		rep(i, m) cin >> p[i];
		
		int ans = 0;
		int maxi = 0;
		REP(i, nmin-1, nmax){
			if(maxi <= p[i] - p[i+1]){
				maxi = p[i] - p[i+1];
				ans = i + 1;
			}
		}
		cout << ans << endl;
		
	}

	return 0;
}