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 = "")
ZnJvbSBtYXRoIGltcG9ydCAqCgphLCBiID0gbWFwKGludCwgaW5wdXQoKS5zdHJpcCgpLnNwbGl0KCkpCm4gPSBtYXgoMixhKQpzID0gIiIKd2hpbGUgbiA8PSBiOgoJc3FydE4gPSBpbnQoMC4xICsgc3FydChuKSkKCWlzUHJpbWUgPSBUcnVlCglwID0gMgoJd2hpbGUgcCA8PSBzcXJ0TjoKCQlpZiBuJXAgPT0gMDoKCQkJaXNQcmltZSA9IEZhbHNlCgkJCWJyZWFrCgkJcCArPSAxCglpZiBpc1ByaW1lOgoJCXMgKz0gKHN0cihuKSArICJcbiIpCgluICs9IDEKcHJpbnQocywgZW5kID0gIiIpCg==