#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
template <typename T>
void debug(vector<T> x) {
  for (auto e : x) {
    cout << e << " ";
  }
  cout << "\n";
}
void solve() {
  long long n;
  cin >> n;
  if (n & 1) {
    for (long long i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << "\n";
    for (long long i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << "\n";
    for (long long i = 0; i < n; i++) {
      cout << (i + i) % n << " ";
    }
    cout << "\n";
    return;
  } else {
    cout << -1;
    cout << "\n";
    return;
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
