Niuniu likes cows. He has n cows in his farm. He loves the cows very much, but the cows seem unhappy. Niuniu figures out why this happens. The cows are arranged in a sequence. Two cows may become unhappy when they are adjacent in the sequence. Every cow has a characteristic value, named vi. The unhappiness between cow i and i+1 is defined as vi xor vi+1. (xor is exclusive OR) Niuniu wants the largest unhappiness between each pair of adjacent cows to be as low as possible. You need to tell him a permutation pi, so that when the i-th position is the pi-th cow in the new sequence, the largest unhappiness is as low as possible. Among all the permutations, you need to tell him the lexicographically smallest one.
输入描述:
The first line contains one integer n, which is the number of cows. The second line contains n integers, v1 v2 … vn, separated by a space. (2 ≤ n ≤ 300000, 0 ≤ vi ≤ 1000000000)
输出描述:
Print a single line with n numbers, which means the permutation.
备注:
This problem contains a large number of testcases. Please, check your code carefully before you submit and wait patiently for the result.