def main():
t=int(raw_input())
for i in range(t):
n=int(raw_input())
arr=[]
str_arr = raw_input().split(’ ')
arr = [int(num) for num in str_arr]
brr=[]
brr=map(times,arr)
ans=0
for k in brr:
ans=ans^k
print(str(ans))
def times(m):
return 2*m