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