#include <bits/stdc++.h>
using namespace std;
int n;
int a[100000], b[100000], c[100000];
int main() {
  cin >> n;
  if (n % 2 == 0) {
    cout << "-1";
  } else {
    for (int i = 0; i < n; i++) {
      a[i] = i;
    }
    for (int i = 0; i < n - 1; i++) {
      b[i] = i + 1;
    }
    b[n - 1] = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] + b[i] >= n) {
        c[i] = a[i] + b[i] - n;
      } else {
        c[i] = a[i] + b[i];
      }
    }
    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;
  }
}
