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