#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::deque;
using std::endl;
using std::map;
using std::max;
using std::min;
using std::multiset;
using std::pair;
using std::queue;
using std::set;
using std::sort;
using std::stack;
using std::string;
using std::vector;
int main() {
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; i++) cout << i << " ";
  cout << endl;
  for (int i = 0; i < n; i++) cout << i << " ";
  cout << endl;
  for (int i = 0; i < n; i++) cout << (i + i) % n << " ";
  return 0;
}
