#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100010], b[100010], c[100010];
bool vis[100010];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    a[i] = i;
    b[i] = (i + 1) % n;
    c[i] = (a[i] + b[i]) % n;
    if (vis[c[i]]) {
      cout << -1 << endl;
      return 0;
    }
    vis[c[i]] = 1;
  }
  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;
  return 0;
}
