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