#include using namespace std; using ll = long long; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); ll ans = 0; do { ll s = 0; for (int i = 0; i < n / 2; i++) s ^= (a[i] + a[i + n / 2]); ans = max(ans, s); reverse(a.begin() + n / 2, a.end()); } while (next_permutation(a.begin(), a.end())); cout << ans << endl; return 0; }