#include <bits/stdc++.h>
using namespace std;
char c;
inline void read(int &a) {
  a = 0;
  do c = getchar();
  while (c < '0' || c > '9');
  while (c <= '9' && c >= '0') a = (a << 3) + (a << 1) + c - '0', c = getchar();
}
int n;
int main() {
  read(n);
  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("");
    return 0;
  }
  puts("-1");
  return 0;
}
