405857: GYM102135 J Vova, who doesn't know

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Vova, who doesn't knowtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Vova always wants to learn something new. A lot of things he asks Lesha. This time Lesha gave him the following task...

He was given an array of n integers a1, a2, ..., an. It is necessary to find a permutation p such that will be maximal. Vova has not yet come up with a solution, but you got a chance to come up with a solution faster than him.

Recall that the operation , it is also XOR, which is exclusive OR. This operation corresponds to the operator ^ in programming languages C++ and Java. In the Pascal language, the operator xor is responsible for this operation. For numbers 5 and 3, the result of the operation will be: .

Input

The first line of input contains an integer n (1 ≤ n ≤ 8) — the size of the array A.

In the next line there are n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the elements of the array A.

Output

In a single line output n integers p1, p2, ..., pn (1 ≤ pi ≤ n) — permutation at which the maximum XOR-sum of the array is reached. We recall that all elements of the permutation are different. If there are several correct answers, you can output any of them.

ExampleInput
4
21 2 2018 42
Output
2 4 1 3 

加入题单

上一题 下一题 算法标签: