#include<stdio.h>
#include<stdlib.h>

int singleNumber(int* nums, int numsSize)
{
int count[32]={0};
int i,j,number=0;
for(i=0;i<numsSize;i++)
{
for(j=0;j<32;j++)
count[j]+=((nums[i]&(1<<j))!=0);
}
for(i=0;i<32;i++)
{
if(count[i]%3!=0)
number+=(1<<i);
}
return number;
}

int main()
{
int n;
int i,j=0;
while(scanf("%d",&n)!=EOF)
{
int *nums=(int *)malloc(sizeof(int)*n);
for(i=0;i<n;i++)
scanf("%d",&nums[i]);
j=singleNumber(nums, n);
printf("%d\n",j);
}
return 0;
}