#include <bits/stdc++.h>
const int d[8][2] = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1},
                     {0, 1},   {1, -1}, {1, 0},  {1, 1}};
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
using namespace std;
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  if (n % 2 == 0)
    cout << -1;
  else {
    for (int i = 0; i < n; i++) cout << i << ' ';
    cout << endl;
    for (int i = 0; i < n; i++) cout << i << ' ';
    cout << endl;
    for (int i = 0; i < n; i++) cout << (2 * i) % n << ' ';
  }
}
