#include <bits/stdc++.h>
using namespace std;
const int infint = INT_MAX;
const long long infll = LLONG_MAX;
const int MAX = 1e5 + 100;
int main() {
  int n;
  cin >> n;
  vector<int> ans[3];
  if (n % 2 == 0) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    ans[0].push_back(i);
  }
  for (int i = 0; i < n; i++) {
    ans[1].push_back((i + 1) % n);
  }
  for (int i = 0; i < n; i++) {
    ans[2].push_back((ans[0][i] + ans[1][i]) % n);
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < n; j++) cout << ans[i][j] << " ";
    cout << "\n";
  }
  return 0;
}
