#pragma comment(linker, "/STACK:102400000,102400000") #include #include #include #include #include #include #include #include using namespace std; int main() { int test, n; cin >> test; for (int cas = 1; cas <= test; cas++) { scanf("%d", &n); int a; for (int i = 1; i <= n; i++) { scanf("%d", &a); } if (n == 1) printf("%d\n", a); else puts("0"); } return 0; }