import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

/*
mod 6で

3 を偶数個(最大5,000個)
2と4を同数(あわせて最大10,000個)
0 を任意個(最大5,000個)

とればよい

*/

void main(){
	int n = read.to!int;
	
	if(n == 3){
		writeln("2 5 63");
		return;
		}
	
	int[] ans;
	
	int x3, x2, x4, x6;
	if(n <= 5002){
		x3 = (n - 2) / 2 * 2;
		x2 = 1;
		x4 = 1;
		x6 = n - x3 - x2 - x4;
		}
	else if(n <= 15000){
		x3 = 5000;
		x2 = 1 + (n - 5002) / 2 ;
		x4 = 1 + (n - 5002) / 2 ;
		x6 = n - x3 - x2 - x4;
		}
	else{
		x3 = 5000;
		x2 = 5000;
		x4 = 5000;
		x6 = n - x3 - x2 - x4;
		}
	
	for(int i = 0; i < x3; i ++) ans ~= 3 + i * 6;
	for(int i = 0; i < x2; i ++) ans ~= 2 + i * 6;
	for(int i = 0; i < x4; i ++) ans ~= 4 + i * 6;
	for(int i = 0; i < x6; i ++) ans ~= 6 + i * 6;
	
	ans.to!(string[]).join(" ").writeln;
	
	}
