#include #include #include #include #include #include #include #include #include #include #define LL long long #define LD double #define inf 10000000000000000ll using namespace std; int a[2000100]; int main() { int t;scanf("%d",&t); while (t--) { int n;scanf("%d",&n); for (int i=1;i<=n;i++) scanf("%d",&a[i]); if (n==1) printf("%d\n",a[1]);else printf("0\n"); } }