#include <bits/stdc++.h>
using namespace std;
void inn(long long int &ix) { scanf("%lld", &ix); }
void inn(long long int &ix, long long int &iy) { scanf("%lld%lld", &ix, &iy); }
void inn(int &ix) { scanf("%d", &ix); }
void outt(long long int ix) { printf("%lld", ix); }
void outt(long long int ix, char cx) { printf("%lld%c", ix, cx); }
void outt(int ix) { printf("%d", ix); }
void outt(int ix, char cx) { printf("%d%c", ix, cx); }
void pline() { printf("\n"); }
const int MM = 1200000;
long long int m, n, k, p1, p2, p3, p, f, a[MM];
string s, s1, s2;
int main() {
  cin >> n;
  if (n % 2 == 0)
    cout << -1;
  else {
    for (int i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << endl;
    for (int i = 0; i < n; i++) {
      cout << i << " ";
    }
    cout << endl;
    for (int i = 0; i < n; i++) {
      cout << (2 * i) % n << " ";
    }
  }
  return 0;
}
