A. XOR 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$$$. Find all values of $$$x$$$ where $$$1 \le x \le 2^{100}$$$, such that $$$[1 \oplus x, 2 \oplus x, \dots , n \oplus x]$$$ forms a permutation of size $$$n$$$.

Input

The first line contains a single integer $$$n$$$ ($$$1\le n \lt 2^{30}$$$).

Output

If there are no such values of $$$x$$$, output $$$-1$$$. Otherwise, output all valid $$$x$$$.

Examples
Input
6
Output
7
Input
3
Output
-1
Note

In the first sample, for $$$n=6$$$, only $$$x=7$$$ satisfies the condition:

$$$[1\oplus \color{orange}{7}, 2\oplus \color{orange}{7}, 3\oplus \color{orange}{7}, 4\oplus \color{orange}{7}, 5\oplus \color{orange}{7}, 6\oplus \color{orange}{7}]=[6, 5, 4, 3, 2, 1]$$$.