#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, d, a1[100000], a2[100000], a3[100000];
  scanf("%d", &n);
  if (n % 2 == 0) {
    printf("-1\n");
    return 0;
  }
  d = n - 1;
  for (int i = 0; i < n; i++) {
    a1[i] = i;
    a3[i] = (n - 1) - i;
    if (d >= 0)
      a2[i] = d;
    else
      a2[i] = n + d;
    d -= 2;
  }
  printf("%d", a1[0]);
  for (int i = 1; i < n; i++) printf(" %d", a1[i]);
  printf("\n");
  printf("%d", a2[0]);
  for (int i = 1; i < n; i++) printf(" %d", a2[i]);
  printf("\n");
  printf("%d", a3[0]);
  for (int i = 1; i < n; i++) printf(" %d", a3[i]);
  printf("\n");
}
