# 実験すると以下となった T = int(input()) for t in range(T): N = int(input()) if N in [1, 3, 4, 5, 7, 8]: ans = 1 else: ans = 2 print(ans)