#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long mod = 1e9 + 7;
const int oo = 1e9;
int n;
long long t[N];
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
int main() {
  scanf("%d", &n);
  if (!(n & 1)) {
    printf("-1");
    return 0;
  }
  for (int i = 0; i < n; ++i) printf("%d ", i);
  printf("\n");
  for (int i = 0; i < n; ++i) printf("%d ", i);
  printf("\n");
  for (int i = 0; i < n; ++i) printf("%d ", (2 * i) % n);
}
