#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9, M = 1e7, OO = 0x3f3f3f3f;
const long long int MOD = 1e9 + 7;
int main() {
  int n, arr[N];
  scanf("%d", &n);
  if (!(n & 1)) {
    cout << -1;
    return 0;
  }
  int cnt = 0;
  for (int i = 0; i < int(n); ++i) {
    arr[cnt++] = i;
    cout << i << " ";
  }
  cout << '\n';
  cnt = 0;
  for (int i = 0; i < int(n); ++i) {
    arr[cnt++] += i;
    cout << i << " ";
  }
  cout << '\n';
  for (int i = 0; i < int(n); ++i) {
    cout << arr[i] % n << " ";
  }
  return 0;
}
