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