#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 100 + 100;
int a[maxn], cnt;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) cout << i << " ";
  cout << endl;
  for (int i = n - 1; i >= 0; i -= 2) {
    a[cnt++] = i;
    cout << i << " ";
  }
  for (int i = n - 2; i >= 0; i -= 2) {
    a[cnt++] = i;
    cout << i << " ";
  }
  cout << endl;
  for (int i = 0; i < n; i++) cout << (i + a[i]) % n << " ";
  cout << endl;
  return 0;
}
