#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
int a[N];
int b[N];
int c[N];
int used[N];
void bad() {
  puts("-1");
  exit(0);
}
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 0) bad();
  for (int i = 0; i < n; i++) {
    a[i] = i;
    c[i] = n - i - 1;
    b[i] = c[i] - a[i];
    if (b[i] < 0) b[i] += n;
  }
  for (int i = 0; i < n; i++) printf("%d%c", a[i], " \n"[i == n - 1]);
  for (int i = 0; i < n; i++) printf("%d%c", b[i], " \n"[i == n - 1]);
  for (int i = 0; i < n; i++) printf("%d%c", c[i], " \n"[i == n - 1]);
  return 0;
}
