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