#include<cstdio> #include<cctype> #include<cstring> #include<algorithm> longlongread(){ registerlonglong x = 0; registerchar f = 1, ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (ch == '-') f ^= 1; for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ '0'); return f ? x : -x; } #define N 100005 int n; longlong sum, a[N], b[65], ans; voidinsert(longlong x){ for (registerint i = 60; ~i; --i) if (!(sum >> i & 1)) if (x >> i & 1){ if (!b[i]) return b[i] = x, void(0); x ^= b[i]; } for (registerint i = 60; ~i; --i) if (sum >> i & 1) if (x >> i & 1){ if (!b[i]) return b[i] = x, void(0); x ^= b[i]; } } intmain(){ n = read(); for (registerint i = 1; i <= n; ++i) a[i] = read(), sum ^= a[i]; for (registerint i = 1; i <= n; ++i) insert(a[i]); for (registerint i = 60; ~i; --i) if (!(sum >> i & 1)) if (!(ans >> i & 1)) ans ^= b[i]; for (registerint i = 60; ~i; --i) if (sum >> i & 1) if (!(ans >> i & 1)) ans ^= b[i]; printf("%lld\n", sum ^ ans); }