T = int(input()) S = set([1, 3, 4, 5, 7, 8]) for i in range(T): N = int(input()) print(1) if N in S else print(2)