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