from math import *
def ddd():
a, b = map(int, input().strip().split())
for n in range(max(2,a), b+1):
sqrtN = int(sqrt(n) + 1)
isPrime = True
try:
for p in range(2, sqrtN+1):
if (n/p).is_integer():
raise Exception()
except Exception:
isPrime = False
if isPrime:
print(n)
ddd()
ZnJvbSBtYXRoIGltcG9ydCAqCgpkZWYgZGRkKCk6CglhLCBiID0gbWFwKGludCwgaW5wdXQoKS5zdHJpcCgpLnNwbGl0KCkpCglmb3IgbiBpbiByYW5nZShtYXgoMixhKSwgYisxKToKCQlzcXJ0TiA9IGludChzcXJ0KG4pICsgMSkKCQlpc1ByaW1lID0gVHJ1ZQoJCXRyeToKCQkJZm9yIHAgaW4gcmFuZ2UoMiwgc3FydE4rMSk6CgkJCQlpZiAobi9wKS5pc19pbnRlZ2VyKCk6CgkJCQkJcmFpc2UgRXhjZXB0aW9uKCkKCQlleGNlcHQgRXhjZXB0aW9uOgoJCQlpc1ByaW1lID0gRmFsc2UKCQkKCQlpZiBpc1ByaW1lOgoJCQlwcmludChuKQoJCQkKZGRkKCk=