Time limit
1s
Memory limit
512 MB

There is one weight numbered 1 through n. The weight of each item is equal to its number. Each weight has the shape shown in the picture, so other weights can be hung on its left and right. Arrange weights on the left and right sides of a large balance scale while satisfying all of the following rules.
n is odd, exactly one weight is not used.d only after every possible position at depth d-1 has already been filled. In other words, the used weights must be placed with minimum possible depth.If such an arrangement exists, output the two side shapes.
The first line contains an integer n. (2 ≤ n ≤ 100,000)
On the first line, print the weight numbers in the left-side shape. On the second line, print the weight numbers in the right-side shape. Treat each side shape as a rooted binary tree and print its preorder traversal, separated by spaces.
If no valid arrangement exists, print only -1 on the first line.
