#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int N;
  cin >> N;
  if (N % 2 == 0) {
    cout << -1 << '\n';
    exit(0);
  }
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    A[i] = i;
  }
  vector<int> B(N);
  for (int i = 0; i < N; i++) {
    B[i] = (-2 * i + 2 * N) % N;
  }
  vector<int> C(N);
  for (int i = 0; i < N; i++) {
    C[i] = (A[i] + B[i]) % N;
  }
  for (int i = 0; i < N; i++) cout << A[i] << " \n"[i == N - 1];
  for (int i = 0; i < N; i++) cout << B[i] << " \n"[i == N - 1];
  for (int i = 0; i < N; i++) cout << C[i] << " \n"[i == N - 1];
  return 0;
}
