import sys input = sys.stdin.readline T = int(input()) N = [int(input()) for _ in range(T)] for n in N: if n==1: print(1) else: print(0)