#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (!(n & 1)) {
    printf("-1");
    return 0;
  }
  vector<vector<int> > v(3, vector<int>(n));
  for (int i = 0; i < n; i++) v[0][i] = i;
  printf("\n");
  for (int i = 0; i < n; i++) v[1][i] = (i + 1) % n;
  for (int i = 0; i < n; i++) v[2][i] = (v[0][i] + v[1][i]) % n;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", v[i][j]);
    }
    printf("\n");
  }
}
