#include using namespace std; int main() { int t; cin >> t; while (t--) { int res = 0; int n,t; cin >> n; cin >> t; if (n == 1) cout << t << endl; else cout << 0 << endl; n--; while (n--) { cin >> t; } } return 0; }