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