#include <bits/stdc++.h>
using namespace std;
long long poww(long long x, long long y) {
  if (y == 0) return 1;
  long long second = poww(x, y / 2);
  second = (second * second);
  if (y % 2 == 1) second = (second * x);
  return second;
};
bitset<100001> vis;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  if (!(n & 1)) {
    cout << -1;
    return 0;
  }
  vector<int> v1, v2, v3;
  for (int i = 0; i < n; ++i) {
    v1.push_back(i);
    v3.push_back(i);
  }
  reverse(((v3).begin()), ((v3).end()));
  for (int i = 0; i < n; ++i) {
    int string = 0, en = n - 1;
    while (string <= en) {
      int md = ((string + en) >> 1);
      if ((v1[i] + md) % n > (v3[i]) % n) {
        en = md;
      } else if ((v1[i] + md) % n < (v3[i]) % n) {
        string = md + 1;
      } else {
        if ((v1[i] + md) % n == (v3[i]) % n) v2.push_back(md);
        break;
      }
    }
  }
  for (auto &i : v1) {
    cout << i << " ";
  }
  cout << endl;
  for (auto &i : v2) {
    cout << i << " ";
  }
  cout << endl;
  for (auto &i : v3) {
    cout << i << " ";
  }
  return 0;
}
