#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, l = 0, m = 1;
  cin >> n;
  int x[100005], y[100005], z[100005], a[100005];
  if (n % 2 == 0)
    cout << -1 << endl;
  else {
    for (i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << endl;
    for (i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << endl;
    for (i = 0; i < n; i++) {
      cout << (i + i) % n << " ";
    }
    cout << endl;
  }
}
