#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(T& a) {
  for (auto x : a) cout << x << " ";
}
int main() {
  int i, j, k = 0, x, y, r, n, ans = 0;
  cin >> n;
  if (n % 2) {
    for (i = 0; i < n; i++) cout << i << " ";
    cout << endl;
    for (i = 0; i < n; i++) cout << i << " ";
    cout << endl;
    for (i = 0; i < n; i += 2) cout << i << " ";
    for (i = 1; i < n; i += 2) cout << i << " ";
  } else
    cout << -1;
}
