for _ in range(int(input())): N = int(input()) if N == 2 or N > 8: print(2) else: print(1)