#include void set_segt (int t[][2], int idx, int val, int size) { idx = idx+size-1; t[idx][0] = val; t[idx][1] = idx-size+1; while (idx > 0) { idx = (idx-1)/2; if (t[2*idx+1][0] > t[2*idx+2][0]) { t[idx][0] = t[2*idx+1][0]; t[idx][1] = t[2*idx+1][1]; } else { t[idx][0] = t[2*idx+2][0]; t[idx][1] = t[2*idx+2][1]; } } return; } int argmax_segt_rec (int t[][2], int a, int b, int k, int l, int r, int *argmax) { int ans = 0; int tmp = 0; int tmp_argmax = 0; if (r <= a || b <= l) { *argmax = -1; return 0; } if (a <= l && r <= b) { *argmax = t[k][1]; return t[k][0]; } ans = argmax_segt_rec(t, a, b, 2*k+1, l, (l+r)/2, argmax); tmp = argmax_segt_rec(t, a, b, 2*k+2, (l+r)/2, r, &tmp_argmax); if (tmp > ans) { ans = tmp; *argmax = tmp_argmax; } return ans; } int argmax_segt (int t[][2], int a, int b, int size) { int ans = 0; int max = argmax_segt_rec(t, a, b, 0, 0, size, &ans); return ans; } int main () { int n = 0; int a[75000] = {}; int i = 0; int k = 0; int ret = 0; int res = 0; int xor = 0; int p = 0; int size = 1; int segt[17][300000][2] = {}; res = scanf("%d", &n); while (size < n) { size *= 2; } for (int i = 0; i < n; i++) { res = scanf("%d", a+i); xor ^= a[i]; for (int j = 0; j < 17; j++) { set_segt(segt[j], i, (a[i]&(1< 0) { p = 1; } printf("%d\n", p); fflush(stdout); while (ret >= 0) { if (p > 0) { int b = 16; while ((xor&(1<