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