#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, n) for(int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=(1LL<<60);
const ld pi=acosl(1);
const ll mod = 1000000007;
//const ll mod = 998244353;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};

bool check(ll n){
  //2の倍数をk個
  for(ll k=1;k<n;k++){
    if((n-2*k)%3!=0)continue;
    ll l=(n-2*k)/3;
    if(!(1<=3*l&&3*l<=15000))continue;
    if(!(1<=2*k&&2*k<=5000))continue;
    //cout<<k<<" "<<l<<endl;
    rep(i,3*l)cout<<2*(i+1)<<" ";
    rep(i,2*k)cout<<3*(2*i+1)<<" ";
    cout<<endl;
    return true;
  }
  return false;
}

bool solve(){
  ll n;cin>>n;
  if(n==3){
    cout<<"2 5 63"<<endl;
  }
  else if(n==4){
    cout<<"2 5 20 63"<<endl;
  }
  else if(n==6){
    cout<<"2 5 63 630 1260 2520"<<endl;
  }
  else if(n==19999){
    set<ll>ans;
    rep(i,15000)ans.insert(2*(i+1));
    rep(i,10000)ans.insert(3*(i+1));
    ll y=0;
    /*rep(x,30001){
      if(ans.find(x)==ans.end())continue;
      ans.erase(x);
      ll sum=0;
      for(auto&&i:ans)sum+=i;
      bool isOK=true;
      for(auto&&i:ans){
        if(__gcd(sum-i,i)==1){
          isOK=false;
        }
        if(!isOK)break;
      }
      if(isOK){
        cout<<ans.size()<<endl;
        cout<<"OK"<<x<<endl;
        return true;
        y=x;
        cout<<sum<<endl;
      }
      ans.insert(x);
      if(isOK)break;
    }*/
    ans.erase(6);
    ll sum=0;
    for(auto&&i:ans)sum+=i;
    if(ans.size()!=19999)return true;
   // cout<<sum<<endl;
    for(auto&&i:ans){
      if(__gcd(sum-i,i)==1){
        cout<<i<<" out"<<endl;
        return true;
      }
    }
    for(auto&&i:ans)cout<<i<<" ";
    cout<<endl;
    // cout<<ans.size()<<endl;
  }
  else check(n);
  return false;
  //rep(i,20001)if(!check(i))cout<<i<<endl;
  
}

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);cout<<fixed;
  cout<<setprecision(30);
  if(solve())return 1;
}


Measured memory_bytes: 1280