#include <stdio.h>

#define ZERO 0
#define TWO 2
#define THREE 3
#define INIT_CNT 1
#define EXIT_SUCCESS 0
#define EVEN_DISC( x ) x % 2

static void prime_disc( unsigned long ulW_Dtestcase );

int main( void )
{
	unsigned long ulW_Dtestcase;

	scanf("%ld", &ulW_Dtestcase );
	prime_disc( ulW_Dtestcase );
	return EXIT_SUCCESS;
}

static void prime_disc( unsigned long ulW_Dtestcase )
{
	unsigned long ulW_Ccnt;
	unsigned long ulW_Dcalc;
	unsigned long ulW_Dcalc_sub;
	
	for( ulW_Ccnt = INIT_CNT; ulW_Ccnt <= ulW_Dtestcase; ulW_Ccnt++ ){
		ulW_Dcalc = EVEN_DISC( ulW_Dtestcase );
		if( ulW_Ccnt == TWO){
			printf("%ld", ulW_Ccnt);
		}
		else if( ( ulW_Ccnt < TWO ) || ( ulW_Dcalc == ZERO ) ){
			continue;
		}
		ulW_Dcalc = THREE;
		ulW_Dcalc_sub = sqrt( ulW_Ccnt );
		while( ulW_Dcalc <= ulW_Dcalc_sub ){
			if( EVEN_DISC( ulW_Ccnt ) == ZERO ){
				continue;
			}
			else{
				/*else?????????????????????????????\*/
			}
			ulW_Dcalc += TWO;
		}
		printf("%ld", ulW_Ccnt);
	}
}