#include // #include using namespace std; // using namespace atcoder; typedef int64_t lint; #define rep(i, n) for(int i=0; i; using vvi = vector>; template inline void vin(vector& v) { rep(i, v.size()) cin >> v.at(i); } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template inline void drop(T x) { cout << x << endl; exit(0); } template void vout(vector v) { rep(i, v.size()) { cout << v.at(i) << ' '; } cout << endl; } constexpr lint LINF = LLONG_MAX/2; int main() { lint N; cin >> N; vi v, w; lint a=0, b=0, c=0, x, y, z; if (N%3 != 2) { rep(i, N) v.pb(3*(i+1)); rep(i, N-1) w.pb(3*(i+1)-2); rep(i, N) a += v[i]; rep(i, N-1) b += w[i]; w.pb(a-b); c = N-2; while (w[N-1] > 10000) { w[c] += 3; w[N-1] -= 3; c--; } } else { rep(i, N) v.pb(3*(i+1)); rep(i, N) w.pb(3*(i+1)-2); rep(i, N) a += v[i]; rep(i, N) b += w[i]; w[N-2] += (a-b)/2; w[N-1] += (a-b)/2; c = N-2; while (w[N-1] > 10000) { w[c] += 3; w[N-1] -= 3; c--; } while (w[N-2] > 10000-3) { w[c] += 3; w[N-2] -= 3; c--; } } vout(v); vout(w); }