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