#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  long long int a, b, x, n, m, k, sum = 0, ans = 0, res = 0;
  cin >> n;
  if (n % 2 == 1) {
    for (int i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << "\n";
    for (int i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << "\n";
    for (int i = 0; i < n; i += 2) {
      cout << i << " ";
    }
    for (int i = 1; i < n; i += 2) {
      cout << i << " ";
    }
    cout << "\n";
  } else {
    cout << -1;
  }
  return 0;
}
