#include <bits/stdc++.h>
using namespace std;
void readFile() {}
long long binpow(long long a, long long b) {
  if (b == 0) return 1;
  long long res = binpow(a, b / 2);
  if (b % 2)
    return res * res * a;
  else
    return res * res;
}
int main() {
  readFile();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  if (n % 2 == 0)
    cout << -1 << endl;
  else {
    for (int i = 0; i <= n - 1; i++) cout << i << " ";
    cout << endl;
    for (int i = 0; i <= n - 1; i++) cout << i << " ";
    cout << endl;
    for (int i = 0; i <= n - 1; i++) {
      cout << (2 * i) % n << " ";
    }
    cout << endl;
  }
  return 0;
}
