#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  vector<int> v1, v2, v3;
  int n;
  cin >> n;
  for (auto i = 0; i < (long long)(n); i++) v1.push_back(i), v2.push_back(i);
  bool visited[100010] = {};
  for (auto i = 0; i < (long long)(n); i++) {
    int temp = v1[i] + v2[i];
    int y = temp % n;
    if (!visited[y])
      visited[y] = true, v3.push_back(y);
    else {
      cout << -1;
      return 0;
    }
  }
  for (auto i = 0; i < (long long)(((int)((v1).size()))); i++)
    cout << v1[i] << " ";
  cout << '\n';
  for (auto i = 0; i < (long long)(((int)((v2).size()))); i++)
    cout << v2[i] << " ";
  cout << '\n';
  for (auto i = 0; i < (long long)(((int)((v3).size()))); i++)
    cout << v3[i] << " ";
  cout << '\n';
  return 0;
}
