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