#include #include #include void solve() { int n; std::cin >> n; std::vector xs(n); for (auto& x : xs) std::cin >> x; std::function dfs = [&](int b, int s) -> int { int i = 0; while ((b >> i) & 1) ++i; if (i == n) return s; int ret = 0; for (int j = i + 1; j < n; ++j) { if ((b >> j) & 1) continue; int ns = s ^ (xs[i] + xs[j]); int nb = b | (1 << i) | (1 << j); ret = std::max(ret, dfs(nb, ns)); } return ret; }; std::cout << dfs(0, 0) << "\n"; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }