#include <bits/stdc++.h>
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long MOD1 = 998244353;
using namespace std;
long long power(unsigned long long x, unsigned long long y) {
  unsigned long long res = 1;
  while (y > 0) {
    if (y & 1) res = (unsigned long long)(res * x);
    y = y >> 1;
    if (x <= 100000000) x = (unsigned long long)(x * x);
  }
  return res;
}
int main() {
  long long N;
  cin >> N;
  if (N % 2 == 0)
    cout << -1;
  else {
    for (int i = 0; i <= N - 1; i++) cout << i << ' ';
    cout << '\n';
    for (int i = 1; i <= N - 1; i++) cout << i << ' ';
    cout << 0 << ' ';
    cout << '\n';
    for (int i = 0; i <= N - 1; i++) {
      if (i != N - 1) cout << (2 * i + 1) % N << ' ';
      if (i == N - 1) cout << N - 1;
    }
    cout << '\n';
  }
  return 0;
}
