CPguessr

One Codeforces problem. Guess how hard it is.

Daily #36 5h 26m

The Red Button

1s · 256 MB

Piegirl found the red button. You have one last chance to change the inevitable end.

The circuit under the button consists of nn nodes, numbered from 0 to nn - 1. In order to deactivate the button, the nn nodes must be disarmed in a particular order. Node 0 must be disarmed first. After disarming node ii , the next node to be disarmed must be either node (2⋅i)(2·i) modulo nn or node (2⋅i)+1(2·i)+1 modulo nn . The last node to be disarmed must be node 0. Node 0 must be disarmed twice, but all other nodes must be disarmed exactly once.

Your task is to find any such order and print it. If there is no such order, print -1.

Input

Input consists of a single integer nn ( 2<=n<=1052<=n<=10^{5} ).

Output

Print an order in which you can to disarm all nodes. If it is impossible, print -1 instead. If there are multiple orders, print any one of them.

Input
2
Output
0 1 0
Input
3
Output
-1
Input
4
Output
0 1 3 2 0

How hard is this problem?

Guessing pays XP and coins, so it needs an account. Read the problem, then sign in to lock in a rating.

How scoring works

Type any whole number. The answer is clist's rating, a whole-integer estimate from the performance of everyone who attempted the problem, so it lands on values like 759 or 1437 and is not capped at Codeforces' 3500. Within 50 counts as exact and pays in full; reward falls off exponentially from there, so a couple of hundred out still pays well and a guess several bands away is worth close to nothing. Playing always pays something.

The contest, problem index and tags stay hidden until you guess: a Div. 2 A is rated 800 far more often than not, so the index alone would hand you the answer. Problems are drawn from the 8,617 rated Codeforces problems with at least a thousand solvers, so the rating has settled. Each day draws one rating band at random, so every difficulty comes up equally often and yesterday's answer says nothing about today's.

One problem per player per day, scored on your first guess.