#include <bits/stdc++.h>
using namespace std;
int a[111111], b[111111], c[111111];
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0 << endl << 0 << endl << 0 << endl;
    return 0;
  }
  if (n & 1) {
    for (int i = 0; i < n; i++) c[i] = i;
    int t = 2;
    for (int i = 0; i < n; i++) {
      b[i] = t;
      t = (t + 2) % n;
    }
    for (int i = 0; i < n; i++) {
      a[i] = (c[i] - b[i] + n) % n;
    }
    for (int i = 0; i < n; i++) cout << a[i] << ' ';
    cout << endl;
    for (int i = 0; i < n; i++) cout << b[i] << ' ';
    cout << endl;
    for (int i = 0; i < n; i++) cout << c[i] << ' ';
    cout << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
