#include using namespace std; using ll = long long; template using vt = vector; template using vvt = vector>; template using ttt = tuple; using tii = tuple; using vi = vector; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define pb push_back #define mt make_tuple #define ALL(a) (a).begin(),(a).end() #define FST first #define SEC second #define DEB cerr<<"!"<0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;} inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;} /*Coding Space*/ // ペアの全探索は a.begin(), a.begin() + n/2, a.end() として a[i],a[i+n/2](i = 0..n/2) template // T は双方向イテレータ inline constexpr bool next_patial_permitation(T first, T middle, T last){ // nP_middleを列挙 reverse(middle, last); return next_permutation(first, last); } int main(){ int n; cin >> n; vi in(n); rep(i,n) cin >> in[i]; sort(ALL(in)); int ans = 0; do{ int tans = 0; rep(i,n/2) tans ^= in[i] + in[i + n/2]; ans = max(ans, tans); }while(next_patial_permitation::iterator>(in.begin(), in.begin() + n/2, in.end())); cout << ans << endl; }