#include using namespace std; int arr[2000]; int main() { int T; cin >> T; for(int i = 0;i < T;i ++) { int n; cin >> n; for(int j = 0;j < n;j ++) cin >> arr[j]; if(n == 1) cout << arr[0] << endl; else cout << "0" << endl; } return 0; }