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