program test
implicit none

integer :: sosuu(55555)=1,i,j,k,nn,n,ans(55555),count=0

read(*,*) n

sosuu(1) = 0

nn = int(55555**0.5)

do i=2,nn
	do j=2,55555
		if(j>i .and. mod(j,i) == 0)then
			sosuu(j) = 0
		endif
	enddo
enddo

count=0
do i=1,55555
	if(sosuu(i)==1 .and. mod(i,10)==1 )then
		count =count + 1
		ans(count)=i
	endif

	if(count == 55)then
	goto 100
	endif

enddo

100 continue

write(*,*) ans(1:n)

end program