# 1929번. 소수 구하기
importsysinput=sys.stdin.readlinem,n=map(int,input().split())max=1000000# 에라스토테네스의 체
defetc(max):pList=[True]*maxmnum=int(max**0.5)foriinrange(2,mnum+1):ifpList[i]:forjinrange(i+i,max,i):pList[j]=Falseelse:continuereturn[iforiinrange(2,max)ifpList[i]]pList=etc(max)forpinpList:ifp>=mandp<=n:print(p)