#include <bits/stdc++.h>
using namespace std;
long long n, a[111111], i, k, l, r, s[111111], ans;
int main() {
  cin >> n;
  if (n % 2 == 0) {
    cout << -1;
    return 0;
  }
  for (i = 0; i < n; i++) {
    cout << i << " ";
  }
  cout << endl;
  for (i = 0; i < n; i++) cout << i << " ";
  cout << endl;
  for (i = 0; i < n; i++) cout << (i + i) % n << " ";
}
