#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 0) {
    printf("-1");
    return 0;
  }
  for (int i = n - 1; i >= 0; --i) {
    printf("%d ", i);
  }
  printf("\n");
  int x = 1;
  for (int i = 0; i < n / 2; ++i, x += 2) {
    printf("%d ", x);
  }
  printf("0 ");
  x = 2;
  for (int i = n / 2 + 1; i < n; ++i, x += 2) {
    printf("%d ", x);
  }
  printf("\n");
  for (int i = 0; i < n; ++i) {
    printf("%d ", i);
  }
}
