#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1 << '\n';
    return 0;
  }
  vector<int> a(n), b(n), c(n);
  for (int i = 0; i < (int)n; i++) {
    a[i] = b[i] = i;
    c[i] = (2 * i) % n;
  }
  for (int i : a) cout << i << " ";
  cout << '\n';
  for (int i : b) cout << i << " ";
  cout << '\n';
  for (int i : c) cout << i << " ";
  cout << '\n';
  return 0;
}
