#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  if (b == 0) {
    return a;
  } else {
    return GCD(b, a % b);
  }
}
long long LCM(long long a, long long b) {
  long long gcd = GCD(a, b);
  return (max(a, b) / gcd) * (min(a, b));
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  long long i, j;
  long long t;
  t = 1;
  while (t--) {
    long long n;
    cin >> n;
    if (n % 2) {
      long long a[n], b[n], c[n];
      for (i = 0; i < n; i++) {
        a[i] = b[i] = i;
      }
      for (i = 0; i < n; i++) {
        c[i] = (a[i] + b[i]) % n;
      }
      for (i = 0; i < n; i++) {
        cout << a[i] << " ";
      }
      cout << "\n";
      for (i = 0; i < n; i++) {
        cout << b[i] << " ";
      }
      cout << "\n";
      for (i = 0; i < n; i++) {
        cout << c[i] << " ";
      }
      cout << "\n";
    } else {
      cout << -1 << "\n";
    }
  }
  return 0;
}
