#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  if (n % 2 == 0) return cout << -1, 0;
  for (int i = 0; i < n; i++) printf("%d ", i);
  cout << endl;
  for (int i = 0; i < n; i++) printf("%d ", i);
  cout << endl;
  for (int i = 0; i < n; i++) printf("%d ", (2 * i) % n);
}
