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