#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0 << endl;
    cout << 0 << endl;
    cout << 0 << endl;
    return 0;
  }
  int a[n], b[n], c[n];
  if (n % 2) {
    for (int i = 0; i < n; i++) a[i] = i;
    int l = 1;
    for (int i = 0; i < n; i++) b[i] = l, l++, l %= n;
    for (int i = 0; i < n; i++) c[i] = (a[i] + b[i]) % n;
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
    for (int i = 0; i < n; i++) cout << b[i] << " ";
    cout << endl;
    for (int i = 0; i < n; i++) cout << c[i] << " ";
    cout << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
