#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n);
  if (n & 1) {
    for (int i = 0; i < n; ++i) {
      a[i] = i, b[i] = i;
      c[i] = (a[i] + b[i]) % n;
    }
    for (int i = 0; i < n; ++i) cout << a[i] << ' ';
    cout << '\n';
    for (int i = 0; i < n; ++i) cout << b[i] << ' ';
    cout << '\n';
    for (int i = 0; i < n; ++i) cout << c[i] << ' ';
  } else
    cout << -1;
  return 0;
}
