def ten_to_two(num):
    if num == 0:
        return "0"
    sign = "-" if num < 0 else ""
    num_abs = abs(num)
    rs = []
    while num_abs > 0:
        rs.append(str(num_abs % 2))
        num_abs = num_abs // 2
    return sign + "".join(reversed(rs))

def count_0_1(bin_str):
    # 过滤非0/1字符并统计
    filtered = [c for c in bin_str if c in ("0", "1")]
    filtered_str = "".join(filtered)
    return [filtered_str.count("1"), filtered_str.count("0")]

# 主逻辑
n = int(input())
nums_ten = list(map(int, input().split()))
nums_two = [ten_to_two(num) for num in nums_ten]

rs = []
for bin_str in nums_two:
    c1, c0 = count_0_1(bin_str)
    if c1 % 2 == 0 and c0 % 2 == 0:
        rs.append("10")
    elif c1 % 2 == 0:
        rs.append("1")
    elif c0 % 2 == 0:
        rs.append("0")
    else:
        rs.append("100")

print(" ".join(rs))