#include <bits/stdc++.h>
using namespace std;
int n, m, k, ans, x, y, sum, res, day1, day2, moun1, moun2, year1, year2;
bool l;
char a[100];
string s, s1, s2;
vector<int> v;
int main() {
  cin >> n;
  if (!(n & 1)) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; i++) printf("%d ", i);
  cout << endl;
  for (int i = 0; i < n; i++) printf("%d ", i);
  cout << endl;
  for (int i = 0; i < n; i++) printf("%d ", (i + i) % n);
  return 0;
}
