from math import sqrt
def is_prime(n):
sqrtN = int(sqrt(n) + 1)
for p in range(2, sqrtN+1):
if (n/p).is_integer():
return False
return True
def ddd():
from sys import stdout
a, b = map(int, input().strip().split())
stdout.write('\n'.join(map(str, filter(is_prime, range(max(2,a), b+1)))))
ddd()
ZnJvbSBtYXRoIGltcG9ydCBzcXJ0CgkKZGVmIGlzX3ByaW1lKG4pOgoJc3FydE4gPSBpbnQoc3FydChuKSArIDEpCglmb3IgcCBpbiByYW5nZSgyLCBzcXJ0TisxKToKCQlpZiAobi9wKS5pc19pbnRlZ2VyKCk6CgkJCXJldHVybiBGYWxzZQoJCglyZXR1cm4gVHJ1ZQoKZGVmIGRkZCgpOgoJZnJvbSBzeXMgaW1wb3J0IHN0ZG91dAoJCglhLCBiID0gbWFwKGludCwgaW5wdXQoKS5zdHJpcCgpLnNwbGl0KCkpCglzdGRvdXQud3JpdGUoJ1xuJy5qb2luKG1hcChzdHIsIGZpbHRlcihpc19wcmltZSwgcmFuZ2UobWF4KDIsYSksIGIrMSkpKSkpCgkJCgkJCgkJCQpkZGQoKQ==