#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1;
    return 0;
  }
  pair<pair<int, int>, int> a[n];
  for (int i = 0; i < n; i++) a[i].first.first = a[i].first.second = i;
  for (int i = 0; i < n; i++)
    a[i].second = (a[i].first.first + a[i].first.second) % n;
  for (int i = 0; i < n; i++) cout << a[i].first.first << " ";
  cout << endl;
  for (int i = 0; i < n; i++) cout << a[i].first.second << " ";
  cout << endl;
  for (int i = 0; i < n; i++) cout << a[i].second << " ";
  cout << endl;
}
