#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; int main(){ int n; cin >> n; vector a(n); rep(i,n) cin >> a[i]; int res = 0; for (int bit = 0; bit < (1 << n); bit++) { if (__builtin_popcount(bit) * 2 != n) continue; vector x, y; for (int i = 0; i < n; i++) { if (bit & (1 << i)) x.emplace_back(a[i]); else y.emplace_back(a[i]); } sort(y.begin(), y.end()); do { int tmp = 0; for (int i = 0; i < n/2; i++) tmp ^= x[i] + y[i]; res = max(res, tmp); } while(next_permutation(y.begin(), y.end())); } cout << res << endl; return 0; }