#include #include #include #include #include #include #include using namespace std; const int Maxn=1005; int T,n,ans; int a[Maxn]; int main() { //freopen("A.in","r",stdin); //freopen("A.out","w",stdout); int i,j; scanf ("%d",&T); while(T--) { scanf ("%d",&n); ans=0; for (i=1;i<=n;i++) scanf ("%d",&a[i]),a[i]^=a[i-1]; if (n==1) ans=a[1]; else ans=0; cout<