#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void setIO(string s = "") {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (s.empty()) return;
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
int main() {
  setIO();
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << "-1";
    return 0;
  }
  int cnt = n - 1, cnt2 = min(n - 1, 1);
  vector<int> a, b;
  while (cnt >= 0) {
    a.push_back(cnt--);
    b.push_back(cnt2);
    cnt2 = (cnt2 + 2) % n;
  }
  for (auto &x : a) cout << x << " ";
  cout << '\n';
  for (auto &x : b) cout << x << " ";
  cout << '\n';
  for (int i = 0; i < n; i++) cout << (a[i] + b[i]) % n << " ";
  cout << '\n';
}
