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