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