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