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