#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i;
  int t1[100005], t2[100005], t3[100005];
  bool visited2[100005], visited3[100005];
  cin >> n;
  if (n < 3 && n != 1) {
    cout << -1;
    return 0;
  }
  for (i = 0; i < n; i++) {
    t1[i] = i;
    if (i == 0)
      t2[i] = n - 1;
    else {
      if (!visited2[i - 1]) {
        t2[i] = i - 1;
        visited2[i - 1] = 1;
      } else {
        cout << -1 << endl;
        return 0;
      }
    }
    if (!visited3[(t1[i] + t2[i]) % n]) {
      t3[i] = (t1[i] + t2[i]) % n;
      visited3[(t1[i] + t2[i]) % n] = 1;
    } else {
      cout << -1 << endl;
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
    cout << t1[i] << " ";
  }
  cout << endl;
  for (i = 0; i < n; i++) {
    cout << t2[i] << " ";
  }
  cout << endl;
  for (i = 0; i < n; i++) {
    cout << t3[i] << " ";
  }
  cout << endl;
}
