#include "bits/stdc++.h" #define ALL(obj) (obj).begin(),(obj).end() #define RALL(obj) (obj).rbegin(),(obj).rend() #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define REPR(i, n) for(int i = (int)(n); i >= 0; i--) #define FOR(i,n,m) for(int i = (int)(n); i < int(m); i++) using namespace std; typedef long long ll; const int MOD = 1e9 + 7; const int INF = MOD - 1; const ll LLINF = 4e18; int main() { int n; cin >> n; vector a(n); REP(i, n) cin >> a[i]; int ans = 0; do { int s = 0; REP(i, n / 2) { s ^= a[i] + a[i + n / 2]; } ans = max(ans, s); reverse(a.begin() + n / 2, a.end()); } while (next_permutation(ALL(a))); cout << ans << endl; getchar(); getchar(); }