#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1;
  } else {
    int a[3][n];
    for (int i = 0; i < n; i++) {
      a[0][i] = i;
      a[1][i] = i + 1;
      if (a[1][i] == n) {
        a[1][i] = 0;
      }
    }
    for (int i = 0; i < n; i++) {
      a[2][i] = (a[0][i] + a[1][i]) % n;
    }
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < n; j++) {
        cout << a[i][j] << " ";
      }
      cout << "\n";
    }
  }
}
