#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  if (n & 1) {
    long long a[n], b[n], c[n];
    for (long long i = 0; i < n; i++) {
      a[i] = i;
      b[i] = i;
    }
    for (long long i = 0; i < n; i++) {
      c[i] = (a[i] + b[i]) % n;
    }
    for (long long i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
    for (long long i = 0; i < n; i++) cout << b[i] << " ";
    cout << "\n";
    for (long long i = 0; i < n; i++) cout << c[i] << " ";
    cout << "\n";
  } else
    cout << "-1";
  return 0;
}
