#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n;
int read() {
  int f = 1, x = 0;
  char ss = getchar();
  while (ss < '0' || ss > '9') {
    if (ss == '-') f = -1;
    ss = getchar();
  }
  while (ss >= '0' && ss <= '9') {
    x = x * 10 + ss - '0';
    ss = getchar();
  }
  return f * x;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  n = read();
  if (n & 1) {
    for (int i = 0; i < n; i++) printf("%d ", i);
    puts("");
    for (int i = 0; i < n; i++) printf("%d ", i);
    puts("");
    for (int i = 0; i < n; i++) printf("%d ", i * 2 % n);
    puts("");
  } else
    puts("-1");
  return 0;
}
