#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 7;
const long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a, b, c;
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    a.push_back(i);
    b.push_back(i);
    c.push_back((2 * i) % n);
    mp[c.back()]++;
    if (mp[c.back()] == 2) {
      cout << "-1";
      return 0;
    }
  }
  for (auto i : a) cout << i << " ";
  cout << "\n";
  for (auto i : b) cout << i << " ";
  cout << "\n";
  for (auto i : c) cout << i << " ";
}
