#include #include #include #include #include #include #include #include #include #include #include #define MAX_N 100001 #define INF_INT 2147483647 #define INF_LL 9223372036854775807 #define REP(i,n) for(int i=0;i<(int)(n);i++) void init(int n); int find(int n); void unite(int x,int y); bool same(int x, int y); int dx[4] = {1,0,0,-1}; int dy[4] = {0,1,-1,0}; using namespace std; typedef long long int ll; typedef pair P; bool cmp_P(const P &a,const P &b){ return a.second < b.second; } int N,m=-1; vector sets(0); vector est(14); int solve(int code,int mochi){ int back=code; if(code == 0){ int tmp =0; REP(i,N/2){ tmp = tmp^est[i]; } m = max(m,tmp); return 0; } else{ for(int i=0;i> i)&1){ code = code ^ (1 << i); for(int j=i+1;j> j) & 1){ code = code ^ (1 << j); est[mochi] = sets[i]+sets[j]; solve(code,mochi-1); code = code ^ (1 << j); } } } code = back; } } return m; } int main() { int A; cin >> N; REP(i,N){ cin >> A; sets.push_back(A); } sort(sets.begin(),sets.end()); solve((1 << N)-1,N/2-1); cout << m << endl; return 0; }