#include <bits/stdc++.h>
using namespace std;
int inf = 2147483647;
const long long ll = 9223372036854775807, ninf = 1000000000;
const double eps = 1e-6;
const long long nll = 223372036854775807;
int A[100005] = {};
int B[100005] = {};
int C[100005] = {};
int main() {
  int a;
  while (cin >> a) {
    if (a % 2 == 0) {
      cout << -1 << '\n';
      continue;
    }
    int n = 0, k = 0;
    for (int i = n; i < a; i += 2) {
      A[i] = k, B[i] = k, C[i] = 2 * k;
      C[i] %= a;
      k++;
    }
    n = 1;
    for (int i = n; i < a; i += 2) {
      A[i] = k, B[i] = k, C[i] = 2 * k;
      C[i] %= a;
      k++;
    }
    for (int i = 0; i < a; i++) {
      cout << A[i] << " ";
    }
    cout << '\n';
    for (int i = 0; i < a; i++) {
      cout << B[i] << " ";
    }
    cout << '\n';
    for (int i = 0; i < a; i++) {
      cout << C[i] << " ";
    }
    cout << '\n';
  }
  return 0;
}
