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