#include <bits/stdc++.h>
using namespace std;
int n, inq[100005];
vector<int> ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    ans.push_back((i * 2) % n);
    if (inq[ans[i]]) {
      printf("-1\n");
      return 0;
    }
    inq[ans[i]] = 1;
  }
  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++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
