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