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