#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n);
  if (n == 1) {
    cout << 0 << endl;
    cout << 0 << endl;
    cout << 0 << endl;
  } else if (n == 2) {
    cout << -1 << endl;
  } else {
    if (n % 2 == 0)
      cout << -1 << endl;
    else {
      for (int i = 0; i < n; i++) {
        cout << i << " ";
      }
      cout << endl;
      for (int i = 0; i < n; i++) {
        cout << i << " ";
      }
      cout << endl;
      for (int i = 0; i < n; i++) {
        int p = 2 * i;
        cout << p % n << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
