You are given an integer array of length . Find an integer array of length satisfying the following conditions:
Here, denotes bitwise XOR. The MEX of a collection is the smallest nonnegative integer absent from it. The MEX of an empty collection is .
If equal values occur more than once, remove only the occurrence at position when computing . Determine that it is impossible if no valid array exists.
The input is given in the following format:
For each test case, print the answer on one line.
If no valid array exists, print -1. Otherwise, print , separated by spaces. If there are multiple solutions, print any of them.
In the first test case, removing the only element leaves an empty collection, so .
For the fourth test case, the output gives . Thus, .
is the number of test cases. Each test case is given in the following format:
| 2 | 11 | (). |
| 3 | 18 |
|
| 4 | 25 |
|
| 5 | 40 | No additional constraints. |