from math import *
a, b = map(int, input().strip().split())
for n in range(max(2,a), b+1):
sqrtN = int(0.1 + sqrt(n))
isPrime = True
for p in range(2, sqrtN+1):
if n%p == 0:
isPrime = False
break
if isPrime:
print(n)
ZnJvbSBtYXRoIGltcG9ydCAqCgphLCBiID0gbWFwKGludCwgaW5wdXQoKS5zdHJpcCgpLnNwbGl0KCkpCmZvciBuIGluIHJhbmdlKG1heCgyLGEpLCBiKzEpOgoJc3FydE4gPSBpbnQoMC4xICsgc3FydChuKSkKCWlzUHJpbWUgPSBUcnVlCglmb3IgcCBpbiByYW5nZSgyLCBzcXJ0TisxKToKCQlpZiBuJXAgPT0gMDoKCQkJaXNQcmltZSA9IEZhbHNlCgkJCWJyZWFrCglpZiBpc1ByaW1lOgoJCXByaW50KG4pCg==