#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<> typedef long long ll; using namespace std; const int INF = 1e9; const int MOD = 1e9+7; const ll LLINF = 1e18; ll A[15]; int main(){ int N; cin>>N; REP(i,0,N){ cin>>A[i]; } sort(A,A+N); vector b(N,1); REP(i,0,N/2){ b[i]=0; } ll ans=0; do{ vector now,op; REP(i,0,N){ if(b[i]){ now.push_back(A[i]); }else{ op.push_back(A[i]); } } do{ ll tmp=0; REP(i,0,N/2){ tmp^=now[i]+op[i]; } ans=max(ans, tmp); }while(next_permutation(ALL(now))); }while(next_permutation(ALL(b))); p(ans); return 0; }