#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238463;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n & 1) {
    for (int i = 0; i < n; ++i) {
      cout << i << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
      cout << i << " ";
    }
    cout << endl;
    for (int i = 0; i < n; ++i) {
      cout << 2 * i % n << " ";
    }
    cout << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
