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