#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
#pragma warning(disable : 4996)
using namespace std;
const int N = 1e5 + 100;
int a[N], b[N], c[N];
set<int> st;
int main() {
  int n;
  scanf("%d", &n);
  if (!(n & 1)) {
    printf("-1");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    c[i] = i;
    a[i] = n - 1 - i;
    if (a[i] < c[i])
      b[i] = c[i] - a[i];
    else
      b[i] = (c[i] + n - a[i]) % n;
  }
  for (int i = 0; i < n; i++) printf("%d ", a[i]);
  printf("\n");
  for (int i = 0; i < n; i++) printf("%d ", b[i]);
  printf("\n");
  for (int i = 0; i < n; i++) printf("%d ", c[i]);
  return 0;
}
