T = int(input()) nums = {1, 3, 4, 5, 7, 8} for i in range(T): N = int(input()) if N in nums: print(1) else: print(2)