#include <bits/stdc++.h>
using namespace std;
int a[100000];
int main() {
  int n;
  cin >> n;
  if (n % 2 == 1) {
    for (int i = 0; i < n; i++) cout << i << " ";
    cout << endl;
    int cur = n - 2;
    for (int i = 0; i < n / 2; i++) {
      a[i] = cur;
      cur -= 2;
      cout << a[i] << " ";
    }
    cur = n - 1;
    for (int i = n / 2; i < n; i++) {
      a[i] = cur;
      cur -= 2;
      cout << a[i] << " ";
    }
    cout << endl;
    for (int i = 0; i < n; i++) cout << (i + a[i]) % n << " ";
  } else
    cout << "-1";
}
