#include <bits/stdc++.h>
using namespace std;
long int n;
int main() {
  long int i, j, a, b;
  scanf("%ld", &n);
  if (n % 2 == 0) {
    cout << -1;
  } else {
    for (i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << "\n";
    for (i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << "\n";
    for (i = 0; i < n; i = i + 2) {
      cout << i << " ";
    }
    for (i = 1; i < n; i = i + 2) {
      cout << i << " ";
    }
  }
  return 0;
}
