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