M , N = map(int,input().split())
r = N + 100
cheak = [False for _ in range(r)]
for i in range( 2, int(r**0.8) ) : # 2๋ถํฐ ~ ๋ฒ์(r)์ ์ ๊ณฑ๊ทผ๊น์ง
if cheak[i] == False : # ์ง์์ง์ง ์๊ณ , ๊ฐ์ฅ ์์์๋ผ๋ฉด
for j in range( i*2 , r, i ): # i์ 2๋ฐฐ์ ๋ถํฐ, 3๋ฐฐ์, 4๋ฐฐ์, .... ๋ฒ์๋๊น์ง ์ง์ด๋ค.(True๋ก)
cheak[j] = True
prime_number = [i for i,j in enumerate(cheak) if i>=2 and j==False]
for i in prime_number:
if N >= i >= M:
print(i)