B. Crazy Permutation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given an integer $$$N$$$. You have to print a permutation such that for every $$$i$$$ $$$(1 \leq i \leq N)$$$, the value of $$$S_i = P_1 \oplus P_2 \oplus \ldots \oplus P_i$$$ is non zero.

If it is impossible to construct such a permutation, then print $$$-1$$$. Otherwise, print the lexicographically smallest permutation.

$$$\dagger$$$ A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in any order. For example, $$$[2, 3, 1, 5, 4]$$$ is a permutation, but $$$[1, 2, 2]$$$ is not a permutation (the number $$$2$$$ appears twice in the array), and $$$[1, 3, 4]$$$ is also not a permutation (here $$$n = 3$$$, but the array contains the number $$$4$$$).

$$$\dagger$$$ A permutation $$$P$$$ is said to be lexicographically smaller than another permutation $$$Q$$$ if at the first position $$$i$$$ where $$$P_i \ne Q_i$$$, we have $$$P_i \lt Q_i$$$.

For example, among the following permutations of $$$[1, 2, 3]$$$: $$$[1, 2, 3] \lt [1, 3, 2] \lt [2, 1, 3]$$$. So, $$$[1, 2, 3]$$$ is the lexicographically smallest permutation among these.

Input

The only line contains a single integer $$$N (1 \leq N \leq 10^6) $$$.

Output

If it is impossible to construct such a permutation then print $$$-1$$$. Otherwise print the lexicographically smallest permutation.

Example
Input
4
Output
1 2 4 3 
Note

Consider the permutation $$$P = [1, 2, 4, 3]$$$.

Now compute the prefix XOR values:

$$$S_1 = 1$$$

$$$S_2 = 1 \oplus 2 = 3$$$

$$$S_3 = 1 \oplus 2 \oplus 4 = 7$$$

$$$S_4 = 1 \oplus 2 \oplus 4 \oplus 3 = 4$$$

All values are non-zero. Also, this is the lexicographically smallest permutation satisfying the condition.