harbor run -t openthoughts/tasktrove-exp-rpt-taco-v2-taco-8990harbor download openthoughts/tasktrove-exp-rpt-taco-v2-taco-8990There are ( N ) Snuke Cats numbered ( 1, 2, \ldots, N ), where ( N ) is an even number. Each Snuke Cat wears a red scarf, on which his favorite non-negative integer is written.
Recently, they learned about the XOR (exclusive OR) operation. The XOR operation for ( n ) non-negative integers ( x_1, x_2, \ldots, x_n ) is defined as follows:
For example, ( 3 , \text{xor} , 5 = 6 ).
In this problem, each Snuke Cat calculated the XOR of the integers on their scarves, excluding their own. We know the XOR value calculated by Snuke Cat ( i ) is ( a_i ), which represents the XOR of all integers on the scarves except the scarf of Snuke Cat ( i ).
Your task is to restore the integer written on the scarf of each Snuke Cat.
Input is given from standard input in the following format:
N
a_1 a_2 ... a_N
Print a single line containing ( N ) integers separated by spaces. The ( i )-th integer should represent the integer written on the scarf of Snuke Cat ( i ). If there are multiple possible solutions, you may print any of them.
4
20 11 9 24
26 5 7 22
The output is consistent since:
Please implement the solution in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.