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

The circuit under the button consists of n nodes, numbered from 0 to n - 1. In order to deactivate the button, the n nodes must be disarmed in a particular order. Node 0 must be disarmed first. After disarming node i, the next node to be disarmed must be either node (2·i) modulo n or node (2·i) + 1 modulo n. 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 n (2 ≤ n ≤ 105).

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.

Examples

Input

2


Output

0 1 0


Input

3


Output

-1

Input

4


Output

0 1 3 2 0


Input

16


Output

0 1 2 4 9 3 6 13 10 5 11 7 15 14 12 8 0
import java.io.StreamTokenizer;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ListIterator;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.AbstractList;
import java.io.Reader;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		TokenizerReader in = new TokenizerReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    public void solve(@SuppressWarnings("UnusedParameters") int testNumber, TokenizerReader in, PrintWriter out) {
        int n = in.nextInt();
        if (n % 2 == 1) {
            boolean[] taken = new boolean[n];
            ArrayList<Integer> path = new ArrayList<Integer>();
            int cur = 0;
            for (int i = 0; i < n; ++i) {
                path.add(i);
                taken[cur] = true;
                cur = (2*cur + 1) % n;
                if (taken[cur]) {
                    out.println(-1);
                    return;
                }
            }
            if ((2 * cur + 1) % n != 0) {
                out.println(-1);
                return;
            }
            for (int i: path)
                out.print(i + " ");
            out.println(0);
            return;
        }

        if (n == 2) {
            out.println("0 1 0");
            return;
        }

        int k = n / 2;
        int[][] adj = new int[k][2];
        for (int i = 0; i < k; ++i) {
            adj[i][0] = (2*i) % k;
            adj[i][1] = (2*i+1) % k;
        }
        LinkedList<Integer> path = new LinkedList<Integer>();
        path.add(0);
        int cur = 0;
        int sz = 1;
        while (true) {
            if (adj[cur][0] >= 0) {
                int next = adj[cur][0];
                adj[cur][0] = -1;
                cur = next;
                path.add(cur);
                ++sz;
            } else if (adj[cur][1] >= 0) {
                int next = adj[cur][1];
                adj[cur][1] = -1;
                cur = next;
                path.add(cur);
                ++sz;
            } else
                break;
        }
        while (sz != n + 1) {
            int prevSz = sz;
            ListIterator<Integer> i = path.listIterator();
            while (i.hasNext()) {
                if (adj[cur][0] >= 0) {
                    int next = adj[cur][0];
                    adj[cur][0] = -1;
                    cur = next;
                    i.add(cur);
                    ++sz;
                } else if (adj[cur][1] >= 0) {
                    int next = adj[cur][1];
                    adj[cur][1] = -1;
                    cur = next;
                    i.add(cur);
                    ++sz;
                } else
                    cur = i.next();
            }
            if (sz == prevSz) {
                out.println(-1);
                return;
            }
        }
        Integer[] p = new Integer[n+1];
        p = path.toArray(p);
        cur = p[0];
        out.print(cur + " ");
        for (int i = 1; i < n; ++i) {
            if ((2*p[i]) % k == (p[i+1]%k)) {
                cur = 2*cur;
            } else
                cur = 2*cur+1;
            cur %= n;
            out.print(cur + " ");
        }
        out.println(0);
    }
}

class TokenizerReader extends StreamTokenizer {
    public TokenizerReader(InputStream in) {
        super(new BufferedReader(new InputStreamReader(in)));
        defaultConfig();
    }

    public String nextString() {
        try {
            nextToken();
        } catch (IOException e) {
            throw new RuntimeException("nextString: exception in line " + lineno(), e);
        }
        return sval;
    }

    public int nextInt() {
        return Integer.parseInt(nextString());
    }

    public void defaultConfig() {
        resetSyntax();
        wordChars(33, 126);
        whitespaceChars(0, ' ');
    }

    }

