n=int(input()) l=[1,3,4,5,7,8] p=[] for i in range(n): k=int(input()) if k in p: p.append(1) else: p.append(2) for x in p: print(x)