def solve(n): if n in [1, 3, 4, 5, 7, 8]: print(1) else: print(2) for _ in range(int(input())): solve(int(input()))