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