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