#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
template <class P, class Q>
void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
void smax(P &a, Q b) {
  if (b > a) a = b;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n & 1) {
    for (int i = 0; i < n; i++) cout << i << " ";
    cout << endl;
    for (int i = 0; i < n; i++) cout << i << " ";
    cout << endl;
    for (int i = 0; i < n; i++) cout << ((i + i) % n) << " ";
    cout << endl;
  } else
    cout << "-1" << endl;
  return 0;
}
