#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 100030;
int a[maxn], b[maxn];
int main() {
  cin >> n;
  if ((!(n & 1)))
    cout << -1 << endl;
  else {
    for (int i = 0; i < n; i++) {
      printf("%d%s", i, i == n - 1 ? "\n" : " ");
      a[i] = i;
    }
    for (int i = 0; i < n; i++) {
      printf("%d%s", (i + 1) % n, i == n - 1 ? "\n" : " ");
      b[i] = (i + 1) % n;
    }
    for (int i = 0; i < n; i++) {
      printf("%d%s", (a[i] + b[i]) % n, i == n - 1 ? "\n" : " ");
    }
  }
  return 0;
}
