#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 vector> is(30); vector a; int X = 0; void Go(){ int m = 29; for(int i=29;i>=0;i--){ if((X>>i)&1){ m = i; break; } } while(true){ int ii = is[m].back(); is[m].pop_back(); if((a[ii]>>m)&1){ cout<>r; if(r==-1)exit(0); } void Other(){ int i,k; cin>>i>>k; i--; X ^= a[i]; a[i] -= k; X ^= a[i]; rep(j,30){ if((a[i]>>j)&1)is[j].push_back(i); } int r; cin>>r; if(r==-1)exit(0); } int main(){ int n; cin>>n; a.resize(n); rep(i,n){ scanf("%d",&a[i]); rep(j,30){ if((a[i]>>j)&1)is[j].push_back(i); } X ^= a[i]; } if(X!=0){ cout<<1<