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