#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const long long int MAX = -1000000000000000000;
const long long int MIN = 1000000000000000000;
const long long int inf = 1000000000;
const long long int KOK = 100000;
const long long int LOG = 30;
const long long int li = 100005;
const long long int mod = 1000000007;
int n, m, b, a[li], k, flag;
int cev;
string s;
vector<int> v;
int main(void) {
  scanf("%d", &n);
  n--;
  if (n == 0) {
    printf("0\n0\n0\n");
    return 0;
  }
  if (n % 2 == 1) {
    printf("-1\n");
    return 0;
  }
  if (n % 2 == 0) {
    for (int i = 0; i <= n; i++) {
      printf("%d ", i);
    }
    printf("\n");
    for (int i = 0; i <= n; i++) {
      printf("%d ", i);
    }
    printf("\n");
    for (int i = 0; i <= n; i += 2) {
      printf("%d ", i);
    }
    for (int i = 1; i <= n; i += 2) {
      printf("%d ", i);
    }
    printf("\n");
  }
  return 0;
}
