#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  if (n % 2) {
    for (int i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << endl;
    for (int i = 1; i <= n; i++) {
      cout << i % n << " ";
    }
    cout << endl;
    for (int i = 0; i < n; i++) {
      cout << (i + (i + 1) % n) % n << " ";
    }
    cout << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
