#include <bits/stdc++.h>
using namespace std;
const long long N = 1e7 + 7;
const int bigN = 1e9 + 5;
int mod = 1e9 + 7;
int arr[N], temp[N], arr2[N];
int arr1[N];
int matrix1[100][100], matrix2[100][100], matrix3[100][100];
bool boolArr[N];
void init() {
  cin.tie(0);
  cin.sync_with_stdio(0);
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
void yes() { cout << "YES" << endl; }
void no() { cout << "NO" << endl; }
int sizeArr(int arr[]) { return sizeof(arr) / sizeof(arr[0]); }
void solve() {
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << -1 << endl;
  } 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 << (i + i) % n << " ";
    }
  }
}
long long n, m, ans;
char x;
int main() {
  init();
  solve();
  return 0;
}
