#include <bits/stdc++.h>
#pragma GCC optimize "03"
using namespace std;
const long long int inf = INT_MAX;
const double eps = 0.0000001;
const double PI = acos(-1.0);
const long long int MOD = 1e9 + 7;
const long long int N = 1e5 + 5;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  if (n % 2 == 0)
    cout << -1 << '\n';
  else {
    for (long long int i = 0; i < n; i++) cout << i % n << " ";
    cout << '\n';
    for (long long int i = 0; i < n; i++) cout << (i - 1 + n) % n << " ";
    cout << '\n';
    for (long long int i = 0; i < n; i++) cout << (2 * i - 1 + n) % n << " ";
    cout << '\n';
  }
  return 0;
}
