#include #define rep(i,a,b) for(int i=int(a);i> N; vector V(N); int num[N][N] = {}; rep(i,0,N)cin >> V[i]; rep(i,0,N)rep(j,i+1,N)num[i][j] = V[i] ^ V[j]; //rep(i,0,N)rep(j,i+1,N)cout << num[i][j] << " \n"[j==N-1]; int sum = 0; rep(i,0,N/2){ int h,w,maxi = 0; rep(j,0,N)rep(k,0,N){ if(maxi < num[j][k]){ maxi = num[j][k]; h = j,w = k; } } sum += maxi; rep(j,0,N)num[j][w] = num[j][h] = 0; rep(j,0,N)num[h][j] = num[w][j] = 0; } cout << sum << endl; }