n=int(input()) l=[] for i in range(n): s=int(input()) if s%2==0: l.append(2) else: l.append(1) for x in l: print(x)