#include using namespace std; using int64 = long long; using uint64 = unsigned long long; const int MAX_N = 14; int N, match[MAX_N]; int64 A[MAX_N]; int64 dfs(int pos) { int64 res = 0; if (pos == N) { for (int i = 0; i < N; i++) { if (match[i] > i) { res ^= A[i] + A[match[i]]; } } return res; } else if (match[pos] != -1) { return dfs(pos + 1); } for (int partner = pos + 1; partner < N; partner++) { if (match[partner] < 0) { match[pos] = partner; match[partner] = pos; res = max(res, dfs(pos + 1)); match[pos] = match[partner] = -1; } } return res; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; } memset(match, -1, sizeof(match)); // O(N(N-1)!!) cout << dfs(0) << endl; return 0; }