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