#include <bits/stdc++.h>
using namespace std;
const int M = 100000 + 10;
int a[3][M];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    a[0][i] = i;
    a[1][i] = (i + 1) % n;
    a[2][i] = (a[0][i] + a[1][i]) % n;
  }
  if (n % 2 == 0) {
    cout << -1 << endl;
  } else {
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < n; j++) {
        cout << a[i][j] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
