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