#include<bits/stdc++.h>
using namespace std;typedeflonglong ll;constint N =2e5+7;// 定义最大范围int a[N];voidsolve(){int res =0;//用来存储答案int n; cin >> n;for(int i =1; i <= n; i++) cin >> a[i];for(int i =1; i <= n; i++){
res ^= a[i];}
cout << res <<'\n';}intmain(){
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);int _ =1; cin >> _;while(_--)solve();system("pause");return0;}