def solve(): N = int(input()) print(1 if N == 1 else 0) if __name__ == "__main__": T = int(input()) for _ in range(T): solve()