#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, m, a[MAXN], vis[MAXN];
struct Node {
  int v;
  bool vis;
  Node *next;
} * h[MAXN], pool[MAXN * 4];
int tot = 0;
void addEdge(int u, int v) {
  Node *p = &pool[++tot];
  p->v = v;
  p->vis = true;
  p->next = h[u];
  h[u] = p;
}
void dfs(int u) {
  vis[u]++;
  for (Node *p = h[u]; p; p = p->next) {
    if (!p->vis || vis[p->v]) continue;
    p->vis = false;
    dfs(p->v);
  }
  a[++m] = u;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    addEdge(i, (2 * i) % n);
    addEdge(i, (2 * i + 1) % n);
  }
  dfs(0);
  if (m < n) printf("-1\n");
  if ((a[1] * 2) % n != 0 && (a[1] * 2 + 1) % n != 0)
    printf("-1\n");
  else {
    for (int i = m; i >= 1; i--) printf("%d ", a[i]);
    printf("0\n");
  }
  return 0;
}
