#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar1[n];
  int ar2[n];
  int ar3[n];
  if (n % 2 == 0) {
    cout << "-1\n";
    return 0;
  } else {
    int run = n - 1;
    for (int i = 0; i < n; i++) {
      ar1[i] = i;
      ar3[i] = n - 1 - i;
      if (run < 0) {
        run = n - 2;
      }
      ar2[i] = run;
      run -= 2;
    }
    for (int i = 0; i < n; i++) cout << ar1[i] << " ";
    cout << endl;
    for (int i = 0; i < n; i++) cout << ar2[i] << " ";
    cout << endl;
    for (int i = 0; i < n; i++) cout << ar3[i] << " ";
    cout << endl;
  }
  return 0;
}
