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