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>
using namespace std;
template <typename Ty>
class dlist {
 private:
  struct Node {
    int pos;
    Ty v;
    Node *l, *r;
  };
  typedef Node* cnode;
  cnode position;
  int siz;
  void no_position() { cout << "The list is empty!" << endl; }

 public:
  dlist() {
    siz = 0;
    position = nullptr;
  }
  void clear() {
    siz = 0;
    position = nullptr;
  }
  int size() { return siz; }
  bool first() {
    if (not position) {
      no_position();
      return false;
    }
    return (not position->l);
  }
  bool last() {
    if (not position) {
      no_position();
      return false;
    }
    return (not position->r);
  }
  void next() {
    if (not position) {
      no_position();
      return;
    }
    if (last()) {
      cout << "this is already the last node" << endl;
      return;
    }
    position = position->r;
    position->pos = 1 + position->l->pos;
  }
  void previous() {
    if (not position) {
      no_position();
      return;
    }
    if (first()) {
      cout << "this is already the first node" << endl;
      return;
    }
    position = position->l;
  }
  Ty value() {
    if (not position) {
      no_position();
      return 0;
    }
    return position->v;
  }
  void insert(Ty value) {
    ++siz;
    if (not position)
      position = new Node{0, value, nullptr, nullptr};
    else {
      cnode a = new Node{(position->pos) + 1, value, position, position->r};
      if (not last()) position->r->l = a;
      position->r = a;
    }
  }
  void move_to(int pos) {
    if (pos < 0 or pos >= size()) {
      cout << "out of bounds" << endl;
      return;
    }
    while ((position->pos) > pos) previous();
    while ((position->pos) < pos) next();
  }
  void erase() {
    if (last()) {
      cout << "this is the last node, there is none after" << endl;
      return;
    }
    --siz;
    if (not position->r->r) {
      delete position->r;
      position->r = nullptr;
    } else {
      position->r->r->l = position;
      position->r = position->r->r;
    }
  }
};
vector<queue<int> > G;
dlist<int> path;
void H_dfs(int v) {
  path.insert(v);
  path.next();
  if (G[v].empty()) return;
  int u = G[v].front();
  G[v].pop();
  H_dfs(u);
}
vector<long long int> Hierholzer(int v) {
  path.clear();
  path.insert(v);
  for (int i = 0; i < path.size(); ++i) {
    int u = path.value();
    while (not G[u].empty()) {
      H_dfs(u);
      path.move_to(i);
      path.erase();
    }
    if (not path.last()) path.next();
  }
  path.move_to(0);
  vector<long long int> ans(path.size());
  for (int i = 0; i < path.size(); ++i) {
    ans[i] = path.value();
    if (not path.last()) path.next();
  }
  return ans;
}
void solve(int n) {
  if (n & 1) {
    cout << -1 << endl;
    return;
  }
  if (n == 2) {
    cout << "0 1 0" << endl;
    return;
  }
  int m = (n >> 1);
  G = vector<queue<int> >(m);
  for (int i = 1; i < m; ++i) {
    G[i].push((i << 1) % m);
    G[i].push(((i << 1) + 1) % m);
  }
  G[0].push(1);
  vector<long long int> ans = Hierholzer(0);
  ans.push_back(0);
  for (int i = 1; i < ans.size(); ++i) {
    if ((ans[i - 1] << 1) % m == ans[i])
      ans[i] = (ans[i - 1] * 2) % n;
    else
      ans[i] = (ans[i - 1] * 2 + 1) % n;
  }
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << ' ';
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  solve(n);
}