/*
*/

//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-8
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007

const int N = 400031;

vector<int> special,ans;
int n;
long long s;

vector<int> special_list1,special_list2,special_list3;
long long pref_S1[N],pref_S2[N],pref_S3[N];

int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}

bool validate(){
	for (int i=0;i<ans.size();i++){
		int othr=0;
		for (int j=0;j<ans.size();j++){
			if (j!=i)
				othr+=ans[j];
		}
		if (gcd(ans[i],othr)==1){
			cout<<i<<"@"<<othr<<" "<<endl;
			return false;
		}
	}

	int Q=ans[0];
	for (int i=0;i<ans.size();i++){
		Q=gcd(Q,ans[i]);
	}
	if (Q>1)
		return false;
	sort(ans.begin(),ans.end());
	for (int i=1;i<ans.size();i++){
		if (ans[i]==ans[i-1])
			return false;
	}
	return true;
}

int main(){
//	freopen("apache.in","r",stdin);
//	freopen("apache.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
//	cin.tie(0);

	for (int i=30000;i>=1;i--){
		if (i%3==0){
			special_list1.push_back(i);
			continue;
		}
		if (i%2==0&&i%5!=0)
		{
			special_list2.push_back(i);
			continue;
		}
		if (i%5==0){
			special_list3.push_back(i);
		}
	}


	reverse(special_list1.begin(),special_list1.end());

	for (int i=0;i<special_list1.size();i++){
		pref_S1[i+1]=pref_S1[i]+special_list1[i];
	}
	for (int i=0;i<special_list2.size();i++){
		pref_S2[i+1]=pref_S2[i]+special_list2[i];
	}
	for (int i=0;i<special_list3.size();i++){
		pref_S3[i+1]=pref_S3[i]+special_list3[i];
	}

	cin>>n;

	if (n==4){
		cout<<2<<" "<<4<<" "<<15<<" "<<9<<endl;
		return 0;
	}
	if (n==3){
		cout<<5<<" "<<27<<" "<<28<<endl;
		return 0;
	}

		int found=0;
		ans.clear();

		//ans.push_back(1);

		for (int i=0;i<=special_list3.size()&&i<n;i++){
			if (found)break;
			if (i+special_list2.size()+special_list1.size()+1<n)
				continue;
			for (int j=0;j<=special_list2.size()&&j<=n-i;j++){
				if (j==n)
					continue;
				if (i+j==0)
					continue;
				if (found)
					continue;
				int need=n-i-j;
				if (need>special_list1.size()||need<0)
					continue;

				int S=pref_S3[i]+pref_S2[j]+pref_S1[need];


				if (i>0&&S%5!=0)
					continue;
				if(j>0&&S%2!=0)
					continue;
				if (need>0&&S%3!=0)
					continue;
				found=1;
				for (int q=0;q<i;q++)
					ans.push_back(special_list3[q]);
				for (int q=0;q<j;q++)
					ans.push_back(special_list2[q]);
				for (int q=0;q<need;q++)
					ans.push_back(special_list1[q]);
			}
		}
	/*	if (!found){
			cout<<n<<" "<<"!!"<<endl;
			while (true);
		}
		else{
			cout<<n<<" OK"<<endl;
		}*/

	for (int i=0;i<ans.size();i++){
		if (i)
			cout<<" ";
		cout<<ans[i];
	}
	cout<<endl;

	//cout<<validate()<<endl;


//	cin.get(); cin.get();
	return 0;
}


Measured memory_bytes: 4864