#include <bits/stdc++.h>
#pragma comment(linker, "/stack:256000000")
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n % 2 == 0) {
    puts("-1");
  } else {
    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);
    printf("\n");
  }
  return 0;
}
