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