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