#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 6LL;
int main() {
  long long int n;
  cin >> n;
  if (n & 1) {
    for (int i = 0; i <= n - 1; i++) {
      if (i) cout << " ";
      cout << i;
    }
    cout << "\n";
    for (int i = n - 1; i >= 0; i -= 2) {
      if (i != n - 1) cout << " ";
      cout << i;
    }
    for (int i = n - 2; i >= 0; i -= 2) {
      cout << " ";
      cout << i;
    }
    cout << "\n";
    for (int i = 0; i <= n - 1; i++) {
      if (i) cout << " ";
      cout << (n - i - 1);
    }
    cout << "\n";
  } else
    cout << "-1\n";
  return 0;
}
