for _ in range(int(input())): print(0 if 2 <= int(input()) else 1)