#include <bits/stdc++.h>
using namespace std;
int n;
bool seen[100001];
int main() {
  cin >> n;
  if (n % 2 == 0) {
    cout << -1 << "\n";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cout << i << " ";
  }
  cout << "\n";
  for (int j = 0; j < n; j++) cout << (j + 1) % n << " ";
  cout << "\n";
  for (int j = 0; j < n; j++) {
    assert(seen[(j + (j + 1) % n) % n] == false);
    seen[((j + (j + 1) % n)) % n] = true;
    cout << (j + (j + 1) % n) % n << " ";
  }
  cout << "\n";
}
