#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1 << endl;
    return 0;
  }
  vector<long long> v1, v2;
  cout << 0;
  v1.push_back(0);
  for (int i = 1; i < n; i++) {
    cout << " " << i;
    v1.push_back(i);
  }
  v2.push_back(0);
  cout << endl << 0;
  for (int i = 1; i < n; i++) {
    cout << " " << i;
    v2.push_back(i);
  }
  cout << endl << (v1[0] + v2[0]) % n;
  for (int i = 1; i < n; i++) {
    cout << " " << (v1[i] + v2[i]) % n;
  }
  cout << endl;
  return 0;
}
