#include #include #include #include #include using namespace std; using i64 = long long; using u64 = unsigned long long; using i32 = int; using u32 = unsigned int; #define rep(i,n) for(int i=0; i<(int)(n); i++) int main() { int N; cin >> N; int l = 111, r = 9960; vector A; // A[i] mod 3 = 0 vector B; // B[i] mod 3 = 1 while(3 <= N){ A.push_back(l); B.push_back(l+1); l += 3; A.push_back(l); B.push_back(l+1); l += 3; A.push_back(r); B.push_back(r-2); r -= 3; N -= 3; } if(N == 1){ B.back()--; r -= 3; A.push_back(l); B.push_back(l+1); l += 6; N = 0; } if(N == 2){ B.back() -= 12; A.push_back(1); B.push_back(7); A.push_back(4); B.push_back(10); } sort(A.begin(), A.end()); sort(B.begin(), B.end()); rep(i,A.size()){ if(i) cout << ' '; cout << A[i]; } cout << '\n'; rep(i,B.size()){ if(i) cout << ' '; cout << B[i]; } cout << '\n'; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } } ios_do_not_sync_instance;