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