M, N = map(int, input().split())
for num in range(M, N):
if num == 1:
continue
is_prime = True
for sub_num in range(2, num):
if num % sub_num == 0:
is_prime = False
break
if is_prime:
print(num)
M, N = map(int, input().split())
def is_prime(num):
i = 2
while i*i <= num:
if not num % i:
return False
i += 1
return True
for num in range(M, N+1):
if num == 1:
continue
if is_prime(num):
print(num)