#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double eps = 1e-9;
int a[1000000];
int b[1000000];
int c[1000000];
int n;
int main() {
  scanf("%d", &n);
  if (n % 2 == 0) {
    printf("-1\n");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    a[i] = i;
    b[i] = (i + 1) % n;
    c[i] = (a[i] + b[i]) % n;
  }
  for (int i = 0; i < n; i++) {
    printf("%d%c", a[i], " \n"[i + 1 == n]);
  }
  for (int i = 0; i < n; i++) {
    printf("%d%c", b[i], " \n"[i + 1 == n]);
  }
  for (int i = 0; i < n; i++) {
    printf("%d%c", c[i], " \n"[i + 1 == n]);
  }
  return 0;
}
