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