#include using namespace std; int main() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } int x = N / 4 * 2; vector> dp(1 << N); dp[0].insert(0); for (int i = 1; i < (1 << N); i++) { if (__builtin_popcount(i) & 1) continue; if (__builtin_popcount(i) > N - x) continue; for (int j = 0; j < N; j++) if (i & (1 << j)) { for (int k = j + 1; k < N; k++) if (i & (1 << k)) { int t = i - (1 << j) - (1 << k); for (auto val : dp[t]) { dp[i].insert(val ^ (A[j] + A[k])); } } } } int res = 0; for (int i = 0; i < (1 << N); i++) { if (__builtin_popcount(i) != x) continue; for (auto v1 : dp[i]) { for (auto v2 : dp[(1 << N) - 1 - i]) { res = max(res, v1 ^ v2); } } } cout << res << endl; return 0; }