#include <cstdio>
using namespace std;
inline void read(int &x){
x=0;char ch;bool flag = false;
while(ch=getchar(),ch<'!');if(ch == '-') ch=getchar(),flag = true;
while(x=10*x+ch-'0',ch=getchar(),ch>'!');if(flag) x=-x;
}
inline int cat_min(const int &a,const int &b){return a<b ? a:b;}
inline int cat_max(const int &a,const int &b){return a>b ? a:b;}
int main(){
freopen("chopsticks.in","r",stdin);
freopen("chopsticks.out","w",stdout);
int n;read(n);
int x = 0;
for(int i=1,y;i<=n;++i){
read(y);
x ^= y;
}
printf("%d",x);
return 0;
}