#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long INFL = 2e18;
const int N = 1e5 + 5;
int n, a[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  if (n % 2 == 0) return cout << -1 << '\n', 0;
  for (int i = (0), _b = (n); i < _b; ++i) cout << i << ' ';
  cout << '\n';
  for (int i = (0), _b = (n); i < _b; ++i) cout << i << ' ';
  cout << '\n';
  for (int i = (0), _b = (n); i < _b; ++i) cout << 2 * i % n << ' ';
  cout << '\n';
  return 0;
}
