#include <bits/stdc++.h>
using namespace std;
int SET(int N, int pos) { return N = N | (1 << pos); }
int RESET(int N, int pos) { return N = N & ~(1 << pos); }
bool CHECK(int N, int pos) { return (bool)(N & (1 << pos)); }
template <typename T>
inline T __lcm(T a, T b) {
  return (a * b) / __gcd(a, b);
}
struct node {
  long long x, y, cnt;
};
int dx[] = {0, 1, 0, -1, -1, 1, -1, 1};
int dy[] = {1, 0, -1, 0, 1, 1, -1, -1};
long long a[1000000];
long long b[1000000];
long long c[1000000];
void solve() {
  long long n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1 << endl;
    return;
  }
  for (long long i = 0; i < n; i++) {
    c[i] = n - i - 1;
  }
  for (long long i = 0; i < n; i++) {
    a[i] = i;
  }
  for (long long i = 0; i < n; i++) {
    b[i] = c[i] - a[i];
    if (b[i] < 0) {
      b[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;
}
int main() {
  solve();
  return 0;
}
