#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100000], b[100000], c[100000], d, n, i, j;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1 << endl;
    return 0;
  }
  for (i = 0; i < n; i++) a[i] = i;
  d = n - 1;
  for (i = 0; i < n; i++) c[i] = d--;
  for (i = 0; i < n; i++) {
    if (c[i] - a[i] > -1)
      b[i] = (c[i] - a[i]) % n;
    else
      b[i] = n - a[i] + c[i];
  }
  for (i = 0; i < n; i++) printf("%d ", a[i]);
  printf("\n");
  for (i = 0; i < n; i++) printf("%d ", b[i]);
  printf("\n");
  for (i = 0; i < n; i++) printf("%d ", c[i]);
  printf("\n");
}
