from sys import stdin input = stdin.readline for _ in range(int(input())): N = int(input()) print(0 if 2 <= N else 1)