nums = [1, 3, 4, 5, 7, 8] t = int(input()) for i in range(t): n = int(input()) if n in nums: print(1) else: print(2)