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