#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int src, dst;
  int weight;
  Edge(int src, int dst, int weight) : src(src), dst(dst), weight(weight) {}
};
bool operator<(const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight
         : e.src != f.src     ? e.src < f.src
                              : e.dst < f.dst;
}
const int MAXN = 100000;
int main() {
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1 << endl;
  } else {
    for (int i = 0; i < (int)n - 1; ++i) cout << i << " ";
    cout << n - 1 << endl;
    for (int i = 0; i < (int)n - 1; ++i) cout << i + 1 << " ";
    cout << 0 << endl;
    for (int i = 0; i < (int)n - 1; ++i) cout << (i + i + 1) % n << " ";
    cout << n - 1 << endl;
  }
  return 0;
}
