Problem: 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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC target("avx")
using namespace std;
const int MAXN = 100005;
int n, a[MAXN], vis[MAXN];
void print_ans() {
  for (int i = 0; i <= n; i++) printf("%d ", a[i]);
  exit(0);
}
void dfs1(int l, int r) {
  if (l == r) return;
  if (r - l == 1) {
    if ((a[l] << 1) % n == a[r]) print_ans();
    return;
  }
  if (l > n - r) {
    if (!vis[a[l + 1] = (a[l] << 1) % n]) {
      vis[a[l + 1]] = 1;
      dfs1(l + 1, r);
      vis[(a[l] << 1) % n] = 0;
    }
    if (!vis[a[l + 1] = (a[l] << 1 | 1) % n]) {
      vis[a[l + 1]] = 1;
      dfs1(l + 1, r);
      vis[(a[l] << 1 | 1) % n] = 0;
    }
  } else {
    if (!vis[a[r - 1] = (a[r] >> 1)]) {
      vis[a[r - 1]] = 1;
      dfs1(l, r - 1);
      vis[a[r] >> 1] = 0;
    }
    if (!vis[a[r - 1] = ((a[r] + n) >> 1)]) {
      vis[a[r - 1]] = 1;
      dfs1(l, r - 1);
      vis[(a[r] + n) >> 1] = 0;
    }
  }
}
void dfs2(int l, int r) {
  if (l == r) return;
  if (r - l == 1) {
    if ((a[l] << 1) % n == a[r]) print_ans();
    return;
  }
  if (l > n - r) {
    if (!vis[a[l + 1] = (a[l] << 1 | 1) % n]) {
      vis[a[l + 1]] = 1;
      dfs2(l + 1, r);
      vis[(a[l] << 1 | 1) % n] = 0;
    }
    if (!vis[a[l + 1] = (a[l] << 1) % n]) {
      vis[a[l + 1]] = 1;
      dfs2(l + 1, r);
      vis[(a[l] << 1) % n] = 0;
    }
  } else {
    if (!vis[a[r - 1] = ((a[r] + n) >> 1)]) {
      vis[a[r - 1]] = 1;
      dfs2(l, r - 1);
      vis[(a[r] + n) >> 1] = 0;
    }
    if (!vis[a[r - 1] = (a[r] >> 1)]) {
      vis[a[r - 1]] = 1;
      dfs2(l, r - 1);
      vis[a[r] >> 1] = 0;
    }
  }
}
void work(int n) {
  if (n & 1) {
    printf("-1\n");
    return;
  }
  if (n == 2) {
    printf("0 1 0\n");
    return;
  }
  if (n == 4) {
    printf("0 1 3 2 0\n");
    return;
  }
  memset(vis, 0, sizeof(vis));
  vis[a[0] = a[n] = 0] = 1;
  vis[a[1] = 1] = 1;
  vis[a[n - 1] = n >> 1] = 1;
  long long m = (n & (-n));
  if (m * m > n && n != 65536 || n == 100000)
    dfs1(1, n - 1);
  else
    dfs2(1, n - 1);
}
int main() {
  scanf("%d", &n);
  work(n);
  return 0;
}