#include #include #include #include #include #include #include #include #include #include #pragma comment(linker, "/STACK:102400000,102400000") using namespace std; const int MN=300+10; const int ME=100000+10; const int MOD=1e9+7; typedef long long LL; typedef unsigned long long ULL; const double pi=acos(-1.0); const int Intmax=(~(1<<31)); const int Intmin=(1<<31); const LL LLmax=(~(1LL<<63)); const LL LLmin=(1LL<<63); const ULL ULLmax=(~(0ULL)); typedef long long LL; int main(){ #ifndef ONLINE_JUDGE freopen("1.cpp","r",stdin); #endif // ONLINE_JUDGE int t; scanf("%d",&t); while(t--){ int n; scanf("%d",&n); int ans=0; if(n==1){ int x; scanf("%d",&x); ans^=x; printf("%d\n",ans); } else{ while(n--){ int x; scanf("%d",&x); } printf("0\n"); } } return 0; }