#include<iostream>
using namespace std;
int N, L, R;
int a[1000007];
main(){
cin >> N >> L >> R;
for (int i = 1; i <= N; i++) {
cin >> a[i];
}
int sum = 1000000;
for(int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
if (i == j) continue;
int tong = a[i] + a[j];
if (L <= tong and tong <= R) {
sum = min(sum, tong);
}
}
}
cout << sum;
}
I2luY2x1ZGU8aW9zdHJlYW0+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IE4sIEwsIFI7CmludCBhWzEwMDAwMDddOwoKbWFpbigpewoJY2luID4+IE4gPj4gTCA+PiBSOwoJZm9yIChpbnQgaSA9IDE7IGkgPD0gTjsgaSsrKSB7CgkJY2luID4+IGFbaV07Cgl9CgkKCWludCBzdW0gPSAxMDAwMDAwOwoJZm9yKGludCBpID0gMTsgaSA8PSBOOyBpKyspIHsKCQlmb3IgKGludCBqID0gMTsgaiA8PSBOOyBqKyspIHsKCQkJaWYgKGkgPT0gaikgY29udGludWU7CgkJCWludCB0b25nID0gYVtpXSArIGFbal07CgkJCWlmIChMIDw9IHRvbmcgYW5kIHRvbmcgPD0gUikgewoJCQkJc3VtID0gbWluKHN1bSwgdG9uZyk7CgkJCX0KCQl9Cgl9CgkKCWNvdXQgPDwgc3VtOwp9Cg==