#include #include #define rep(i,n) for(int i=0;i vi; typedef vector vl; typedef vector> vvi; typedef vector> vvl; typedef long double ld; typedef pair P; ostream& operator<<(ostream& os, const modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const static_modint& a) {os << a.val(); return os;} template istream& operator>>(istream& is, vector& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;} template ostream& operator<<(ostream& os, const pair& p){os << p.first << ' ' << p.second << "\n"; return os;} template ostream& operator<<(ostream& os, const vector& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const vector>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : ""); return os;} int main(){ int n; cin >> n; vl a(n); cin >> a; int m = 62; vi g(m, -1); int minus = 0; auto func = [&](long long x){ vi cnt(m); if(x < 0) return 16; rep(i, m){ if((x >> i) & 1){ cnt[g[i]]++; } } rep(i, m) if(cnt[i] == 0) return i; assert(true); return 0; }; rep(i, m) g[i] = func(i); int prod = 0; rep(i, n){ prod ^= func(a[i]); } if(prod != 0) cout << 1 << "\n"; else cout << 2 << "\n"; /* rep(i, m){ cout << i << ' ' << func(i) << "\n"; } */ return 0; }