#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  bool check[n];
  for (int i = 0; i < n; ++i) {
    check[i] = true;
  }
  int arr2[n];
  for (int i = 0; i < n; ++i) {
    int num = n + (n - 1 - i) - i;
    if (num < n && check[num]) {
      arr2[i] = num;
      check[num] = 0;
    } else if (i <= (n - 1 - i)) {
      num = (n - 1 - i) - i;
      if (num < n && check[num]) {
        arr2[i] = num;
        check[num] = 0;
      } else
        return cout << -1 << '\n', 0;
    } else
      return cout << -1 << '\n', 0;
  }
  for (int i = 0; i < n; ++i) {
    cout << i << ' ';
  }
  cout << '\n';
  for (int i = 0; i < n; ++i) {
    cout << arr2[i] << ' ';
  }
  cout << '\n';
  for (int i = 0; i < n; ++i) {
    cout << (n - 1 - i) << ' ';
  }
  cout << '\n';
  return 0;
}
