from math import *

a, b = map(int, input().strip().split())
n = max(2,a)
s = ""
while n <= b:
	sqrtN = int(0.1 + sqrt(n))
	isPrime = True
	p = 2
	while p <= sqrtN:
		if n%p == 0:
			isPrime = False
			break
		p += 1
	if isPrime:
		s += (str(n) + "\n")
	n += 1
print(s, end = "")
