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