#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1;
    return;
  }
  for (long long int i = 0; i < n; i++) cout << i << " ";
  cout << "\n";
  for (long long int i = 1; i < n; i++) cout << i << " ";
  cout << 0;
  cout << "\n";
  for (long long int i = 1; i < n; i++) {
    cout << (2 * i - 1) % n << " ";
  }
  cout << n - 1;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
