#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n % 2 == 0)
    cout << -1 << '\n';
  else if (n == 0) {
    cout << 0 << '\n' << 0 << '\n' << 0 << '\n';
  } else {
    for (long long i = 0; i < n; i++) cout << i << " ";
    cout << '\n';
    for (long long i = 1; i < n; i++) cout << i << " ";
    cout << 0 << '\n';
    for (long long i = 1; i < n; i += 2) cout << i << " ";
    for (long long i = 0; i < n; i += 2) cout << i << " ";
    cout << '\n';
  }
  return 0;
}
