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
for p in range(2, sqrtN+1):
if n%p == 0:
isPrime = False
break
if isPrime:
print(n)
ddd()
ZnJvbSBtYXRoIGltcG9ydCAqCgpkZWYgZGRkKCk6CglhLCBiID0gbWFwKGludCwgaW5wdXQoKS5zdHJpcCgpLnNwbGl0KCkpCglmb3IgbiBpbiByYW5nZShtYXgoMixhKSwgYisxKToKCQlzcXJ0TiA9IGludChzcXJ0KG4pICsgMSkKCQlpc1ByaW1lID0gVHJ1ZQoJCWZvciBwIGluIHJhbmdlKDIsIHNxcnROKzEpOgoJCQlpZiBuJXAgPT0gMDoKCQkJCWlzUHJpbWUgPSBGYWxzZQoJCQkJYnJlYWsKCQlpZiBpc1ByaW1lOgoJCQlwcmludChuKQoJCQkKZGRkKCk=