#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; #define MOD 1000000007 #define INF 1LL << 59 using ld = long double; int arr[15]; int N; int maxV = 0; void dfs(int d, stack st, bool used[15]) { if (d == N) { int sum = 0; while (st.size()) { sum = sum ^ st.top(); st.pop(); } maxV = max(maxV, sum); return; } for (int i = 0; i < N; ++i) { if (!used[i]) { used[i] = true; if (d % 2 == 1) { int n = st.top(); st.pop(); st.push(n + arr[i]); dfs(d + 1, st, used); st.pop(); st.push(n); } else { st.push(arr[i]); dfs(d + 1, st, used); st.pop(); } used[i] = false; } } } int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); //cout << fixed << setprecision(5); cin >> N; for (int i = 0; i < N; ++i) cin >> arr[i]; bool used[15]; for (int i = 0; i < N; ++i) used[i] = false; stack st; dfs(0, st, used); cout << maxV << endl; return 0; }