G=[-1]*60 def g(n): if n<60 and G[n]>=0:return G[n] f=[0]*60 d=0 m=n while m!=0: if m%2==1:f[g(d)]=1 d+=1 m>>=1 a=0 while f[a]==1:a+=1 if n<60:G[n]=a return a i=input N=range(int(i())) e=1 a=0 A=i().split() for n in N: B=int(A[n]) if B<0:e=1-e else:a^=g(B) print(2 if e==1 and a==0 else 1)