t = int(input()) for _ in range(t): a = int(input()) if a == 1: print(1) else: print(0)