#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(ll i=(a);i<(b);++i) #define per(i,a,b) for(ll i=(b-1);i>=(a);--i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define ctos(c) string(1,c) #define print(x) cout<<#x<<" = "< v; void fp(ll d[NH], ll dd[N], ll index){ if(index==v.sz){ clr(ddd,0); rep(i,0,v.sz){ ddd[dd[i]]+=v[i]; } ll sum = 0; rep(i,0,v.sz/2){ sum ^= ddd[i]; } mx = max(mx,sum); return; } rep(i,0,v.sz/2){ if(d[i]==0){ d[i]=1; dd[index]=i; fp(d,dd,index+1); d[i]=0; break; } } rep(i,0,v.sz/2){ if(d[i]==1){ d[i]=2; dd[index]=i; fp(d,dd,index+1); d[i]=1; } } } int main() { ll n; cin>>n; rep(i,0,n){ ll a; cin>>a; v.pb(a); } ll index = 0; clr(d,0); clr(dd,0); fp(d,dd,index); cout << mx << endl; return 0; }