#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e6 + 5;
const long long MAX = 1e7 + 5;
const double pi = 3.14159265359;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  if (!(n & 1)) {
    cout << -1;
  } else {
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < n; j++) {
        cout << j << " ";
      }
      cout << endl;
    }
    for (int i = 0; i < n; i++) {
      cout << (2 * i) % n << " ";
    }
  }
}
