#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
ll mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1;
    return 0;
  } else {
    vector<int> a, b, c;
    for (int i = 0; i < n; i++) a.push_back(i);
    b.push_back(n - 1);
    for (int i = 0; i < n - 1; i++) {
      b.push_back(i);
    }
    for (int i = 0; i < n; i++) c.push_back((a[i] + b[i]) % n);
    for (int x : a) cout << x << " ";
    cout << endl;
    for (int x : b) cout << x << " ";
    cout << endl;
    for (int x : c) cout << x << " ";
  }
}
