#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long mod(long long x) { return ((x % MOD + MOD) % MOD); }
long long add(long long a, long long b) { return mod(mod(a) + mod(b)); }
long long mul(long long a, long long b) { return mod(mod(a) * mod(b)); }
void solve() {
  long long n;
  cin >> n;
  if (n % 2 == 0) {
    cout << "-1\n";
  } else {
    for (long long i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << endl;
    for (long long i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << endl;
    for (long long i = 0; i < n; i++) {
      cout << (i + i) % n << " ";
    }
    cout << endl;
  }
}
signed main() {
  long long t = 1;
  while (t--) {
    solve();
  }
}
