def f(n):
    n = bin(n)[2:]
    zero = n.count('0')
    one = n.count('1')

    if (zero % 2 == 0) and (one % 2 != 0):
        return '0'
    elif (one % 2 == 0) and (zero % 2 != 0):
        return '1'
    elif (zero % 2 == 0) and (one % 2 == 0):
        return '10'
    
    return '100'


dummy = input()
nums = map(int,input().split())

lst = []
for i in nums:
    lst.append(f(i))

print(' '.join(lst))