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