#include using namespace std; typedef long long ll; typedef pair l_l; typedef pair i_i; template inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } const long long INF = 1e18; //const ll mod = 1000000007; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; if(N == 1) { cout << "0 0 0" << endl; return 0; } if(N == 2) { cout << -1 << endl; return 0; } deque zero, one, two; ll c = N - 1; N--; N--; ll onenum = (N + 2) / 3; ll twonum = (N + 1) / 3; for(ll i = 0; i <= N; i += 3) { zero.push_front(i); zero.push_front(i); zero.push_back(i); } one.push_back(c); ll rest = c - onenum - twonum; for(ll i = 1; i <= N; i += 3) { one.push_back(i); one.push_front(i); if(rest) { one.push_back(i); rest--; } else { one.push_front(i); } } two.push_back(c); two.push_back(c); for(ll i = 2; i <= N; i += 3) { two.push_back(i); two.push_front(i); if(rest) { two.push_front(i); rest--; } else { two.push_back(i); } } for(auto c : zero) cout << c << " "; for(auto c : one) cout << c << " "; for(auto c : two) cout << c << " "; return 0; }