n = int(input()) a = list(map(int,input().split())) for item in a: b = str(bin(item)).replace('0b', '') c, d = b.count('1'), b.count('0') if c % 2 == 0 and d % 2 == 1: print(1, end=' ') elif c % 2 == 1 and d % 2 == 0: print(0, end=' ') elif c % 2 == 0 and d % 2 == 0: print(10, end=' ') else: print(100, end=' ')