// Slower C++ solution:
#include <bits/stdc++.h>



#define fr first

#define sc second

#define mk make_pair

#define pb push_back

#define sz(s) (int)s.size()

#define all(s) s.begin(), s.end()

#define int long long



using namespace std;



const int N = 30005;



int n, u[N], sum = 0, m;



vector <int> ans;



main()

{

    cin >> n;

    m = n;

    if (n == 3)

    {

        puts("2 5 63");

        return 0;

    }

    ans.push_back(2);

    sum = 2;

    u[2] = 1;

    n--;

    for (int i = 30000; ; i -= 2)

    {

        if (n == 2)

        {

            sum -= ans.back();

            i = ans.back();

            u[i] = 0;

            ans.pop_back();

            while (u[i] || (sum + i) % 30 != 0)

                i -= 2;



            sum += i;

            u[i] = 1;

            ans.push_back(i);

            break;

        }

        sum += i;

        ans.pb(i);

        u[i] = 1;

        n--;



        if (i < 100 && n % 10 == 0)

        {

            sum -= ans.back();

            i = ans.back();

            u[i] = 0;

            ans.pop_back();

            while (u[i] || (sum + i) % 30 != 0)

                i -= 2;

            sum += i;

            u[i] = 1;

            ans.push_back(i);

            break;

        }

    }

    /***/

    sum = 0;

    for (int i = 30000; ; i -= 3)

    {

        if (u[i] || i % 2 == 0) continue;



        if (n == 0)

        {

            sum -= ans.back();

            i = ans.back();

            u[i] = 0;

            ans.pop_back();

            while (u[i] || (sum + i) % 30 != 0)

                i -= 3;



            sum += i;

            u[i] = 1;

            ans.push_back(i);

            break;

        }

        sum += i;

        ans.pb(i);

        u[i] = 1;

        n--;



        if (i < 500 && n % 6 == 0)

        {

            sum -= ans.back();

            i = ans.back();

            u[i] = 0;

            ans.pop_back();

            while (u[i] || (sum + i) % 30 != 0)

                i -= 3;



            sum += i;

            u[i] = 1;

            ans.push_back(i);

            break;

        }

    }

    /***/

    sum = 0;

    for (int i = 30000; ; i -= 5)

    {

        if (u[i]) continue;



        if (n == 0)

        {

            sum -= ans.back();

            i = ans.back();

            u[i] = 0;

            ans.pop_back();

            while (u[i] || (sum + i) % 30 != 0)

                i -= 5;



            sum += i;

            u[i] = 1;

            ans.push_back(i);

            break;

        }

        sum += i;

        ans.pb(i);

        u[i] = 1;

        n--;

    }

    int gcd = 0;

    sum = 0;

    assert(ans.size() == m);



    for (auto to : ans) sum += to, gcd = __gcd(to, gcd);



    assert( gcd == 1 );

    for (auto to : ans)

    {

        assert( __gcd( to, sum - to ) != 1 );

    }



    for (auto to : ans)

        cout << to << " ";

}


// Faster C++ solution for the same problem (measured speedup: 4.003231497977924x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define MN 30000

using namespace std;

inline int in(){

    int x=0;bool f=0; char c;

    for (;(c=getchar())<'0'||c>'9';f=c=='-');

    for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0');

    return f?-x:x;

}

int odd[MN+5],evn[3][MN+5],n,tot,cnt;

int main()

{

	n=in();

	if (n==3) {printf("2 5 63");return 0;}

	for (int i=1;i<=MN;++i){

		if (i&1){

			if (!(i%3)) odd[++cnt]=i;

		}else {

			evn[i%3][++evn[i%3][0]]=i;

		}

	}tot=n;

	if (n&1){

		for (int i=2;i<=5000&&tot>3;i+=2){

			tot-=2;printf("%d %d ",odd[i-1],odd[i]);

		}

		for (int i=1;i<=5000&&tot>=2;++i){

			tot-=2;printf("%d %d ",evn[1][i],evn[2][i]);

		}

		for (int i=1;i<=5000&&tot;++i){

			--tot;printf("%d ",evn[0][i]);

		}

	}else{

		for (int i=2;i<=5000&&tot>2;i+=2){

			tot-=2;printf("%d %d ",odd[i-1],odd[i]);

		}

		for (int i=1;i<=5000&&tot>=2;++i){

			tot-=2;printf("%d %d ",evn[1][i],evn[2][i]);

		}

		for (int i=1;i<=5000&&tot;++i){

			--tot;printf("%d ",evn[0][i]);

		}

	}return 0;

}