#include<bits/stdc++.h>
#define int unsigned long long
using namespace std;
inline char gc() {
static char buf[1000010], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000010, stdin), p1 == p2) ? EOF : *p1++;
}
inline int read(){
int res=0;
char ch=gc();
while(ch<'0'||ch>'9')
ch=gc();
while(ch>='0'&&ch<='9'){
res=(res<<1)+(res<<3)+(ch^'0');
ch=gc();
}
return res;
}
static char buf[100];
int len = -1;
inline void flush() {
fwrite(buf, 1, len + 1, stdout);
len = -1;
}
inline void __PC(const char x) {
if (len == 100)
flush();
buf[++len] = x;
}
inline void write(int x) {
if (x > 9)
write(x / 10);
__PC(x % 10 ^ 48);
}
int n,a[50],ans;
void dfs(int now,int sum,int val){
ans^=(sum*val);
if(now>n)
return;
#pragma unroll(20)
for(int i=now;i<=n;++i)
dfs(i+1,sum|(1<<i-1),val^a[i]);
}
signed main(){
n=read();
for(int i=1;i<=n;++i)
a[i]=read();
dfs(1,0,0);
write(ans);
flush();
return 0;
}