Buggy python submission (verdict: Time Limit Exceeded):
# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                if a_l[i][_d] == "0":
                    a_l[i][_d] = "1"
                else:
                    a_l[i][_d] = "0"

print(*[int("".join(x), 2) for x in a_l])

Fixed submission:
# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                if a_l[i][_d] == "0":
                    a_l[i][_d] = "1"
                else:
                    a_l[i][_d] = "0"

print(*[int("".join(x), 2) for x in a_l])

Buggy python submission (verdict: Time Limit Exceeded):
# ABC171 E 

import itertools

n = int(input())
a_l = [format(int(x), "030b") for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                _list = list(a_l[i])
                if _list[_d] == "0":
                    _list[_d] = "1"
                else:
                    _list[_d] = "0"
                a_l[i] = "".join(_list)

print(*[int(x, 2) for x in a_l])

Fixed submission:
# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                if a_l[i][_d] == "0":
                    a_l[i][_d] = "1"
                else:
                    a_l[i][_d] = "0"

print(*[int("".join(x), 2) for x in a_l])

Buggy python submission (verdict: Time Limit Exceeded):
# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

a_l = list(zip(*a_l))

for _d,_tp in enumerate(a_l):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            a_l[_d] = ["1" if x == "0" else "0" for x in a_l[_d]]

a_l = list(zip(*a_l))
print(*[int("".join(x), 2) for x in a_l])

Fixed submission:
# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                if a_l[i][_d] == "0":
                    a_l[i][_d] = "1"
                else:
                    a_l[i][_d] = "0"

print(*[int("".join(x), 2) for x in a_l])

Buggy python submission (verdict: Time Limit Exceeded):
# ABC171 E 

import itertools

n = int(input())
a_l = [format(int(x), "030b") for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                _str = list(a_l[i])
                if _str[_d] == "0":
                    _str[_d] = "1"
                else:
                    _str[_d] = "0"
                a_l[i] = "".join(_str)

print(*[int(x, 2) for x in a_l])

Fixed submission:
# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                if a_l[i][_d] == "0":
                    a_l[i][_d] = "1"
                else:
                    a_l[i][_d] = "0"

print(*[int("".join(x), 2) for x in a_l])

Buggy python submission (verdict: Time Limit Exceeded):
# ABC171 E 

import itertools

n = int(input())
a_l = [format(int(x), "030b") for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _l = list(_tp)
        _l.sort()
        gr = itertools.groupby(_l)
        _num = 0
        for key, group in gr:
            if key == "0":
                _num = len(list(group))
        if _num % 2 == 1:
            for i in range(n):
                _str = list(a_l[i])
                if _str[_d] == "0":
                    _str[_d] = "1"
                else:
                    _str[_d] = "0"
                a_l[i] = "".join(_str)

print(*[int(x, 2) for x in a_l])

Fixed submission:
# ABC171 E 

import itertools

n = int(input())
a_l = [list(format(int(x), "030b")) for x in input().split()]

for _d,_tp in enumerate(zip(*a_l)):
    if "1" not in _tp:
        continue
    if "0" not in _tp:
        continue
    else:
        _num = _tp.count("0")
        if _num % 2 == 1:
            for i in range(n):
                if a_l[i][_d] == "0":
                    a_l[i][_d] = "1"
                else:
                    a_l[i][_d] = "0"

print(*[int("".join(x), 2) for x in a_l])