350. XORomania
Time limit per test: 0.25
second(s)
Memory limit: 65536
kilobytes
input: standard
output: standard
Professor Vasechkin had a notebook with an outstanding set of nonnegative integers
A_{1},
A_{2},...,
A_{n}. Somehow the most remarkable fact that made this set so outstanding appeared to be the impossibility to find such a subset of two or more elements, that XOR of elements in the subset would equal to zero. One day the professor managed to create a new set of integers
B_{1},
B_{2},...,
B_{n(n1)/2} through applying the XOR operations to all pairs of elements of
A set. The set
B was not written in any particular order. Unfortunately due to his natural absentmindedness professor lost the
A set and now he is very confused but still obliged to ask you of a considerable favor. Please restore the set in accordance with the remaining
B set.
Input
The first line describes
M — the amount of numbers in
B set (1 ≤
M ≤ 100,
M =
N x (
N  1) / 2 for some number
N). The second line describes
M numbers —
B_{1},
B_{2},...,
B_{M} (0 ≤
B_{i} ≤ 2
^{31}  1).
Output
Print the
A set in one line through a blank. All elements of
A should be from 0 to 2
^{31}  1 inclusively. If there are several solutions of the problem, you can choose any of them. It is guaranteed that there exists at least one
A set that satisfies the condition.
Example(s)
sample input

sample output

6
30 19 66 13 92 81

94 64 77 28
