#include <bits/stdc++.h>
using namespace std;
long long INF = 1e7;
int mod = 1000000007;
bool check(long long x, long long y, long long p, long long q, long long m) {
  return x <= (p * m) && (y - x) <= (q * m - p * m);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  if (n % 2) {
    for (int i = 0; i < n; ++i) {
      cout << i << " ";
    }
    cout << "\n";
    for (int i = 0; i < n; ++i) {
      cout << i << " ";
    }
    cout << "\n";
    for (int i = 0; i < n; ++i) {
      cout << (i + i) % n << " ";
    }
  } else
    cout << -1;
  return 0;
}
