#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
//using namespace __gnu_pbds;
using namespace std;
const int mod = 998244353;
const int inf = 1e18;
const int maxx = 5e5 + 5;
const int lg = 26;
//typedef tree <int, null_type, less_equal <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;
void solve () {
int n, a, b, ans = inf;
cin >> n >> a >> b;
vector <vector <int> > dp(n + 1, vector <int>(b + 2, inf));
vector <int> g(n + 1, 0), pre(n + 1, 0);
for (int i = 1; i <= n; i++) {
cin >> g[i];
pre[i] = pre[i - 1] + g[i];
}
dp[0][0] = 0;
for (int i = 1; i <= n; i++) {
for (int j = i - 1; j >= 0; j--) {
for (int k = 1; k <= b; k++) {
if (dp[j][k - 1] != inf) {
dp[i][k] = min(dp[i][k], dp[j][k - 1] | (pre[i] - pre[j]));
}
}
}
}
for (int k = a; k <= b; k++) {
ans = min(ans, dp[n][k]);
}
cout << ans << endl;
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
//cin >> t;
while (t--) {
solve();
}
}