// #include #include using namespace std; using namespace atcoder; using ll = long long; #define rep(i, n) for (int i=0; i<(int)(n); ++(i)) #define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i)) #define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i)) #define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i)) #define all(x) (x).begin(), (x).end() const int INF = (int)(1e9); const int BLEN = 17; int main() { int n; scanf("%d", &n); vector a(n); rep(i, n) scanf("%d", &a[i]); vector> bids(BLEN); rep(i, n) rep(j, BLEN) if (a[i]&(1<()), ti = (xval != 0) ? 1 : 0; printf("%d\n", ti); fflush(stdout); int ret = 0; if (ti == 1) { int bi = 31 - __builtin_clz(xval), id = *bids[bi].begin(), ki = a[id] - (a[id]^xval); rep(i, BLEN) if (xval&(1<()); scanf("%d", &ret); if (ret == -1) break; int bi = 31 - __builtin_clz(xval), id = *bids[bi].begin(), ki = a[id] - (a[id]^xval); rep(i, BLEN) if (xval&(1<