def prime(a):

    for i in range(2,a):

        if a % i == 0:

            return False

    return True



x = int(eval(input()))

while prime(x) == False:

    x += 1

print(x)
x = int(eval(input()))

n = 2*10**5

table = [2] * (n+1)

table[1] = 1

for i in range(2, n//2+1):

  for j in range(2*i, n+1, i):

    table[j] += 1

for i in range(x, n+1):

  if table[i] == 2:

    print(i)

    exit()



  
def prime(a):
    for i in range(2, a):
        if a % i == 0:
            return False
    return True


x = int(eval(input()))
while prime(x) == False:
    x += 1
print(x)

x = int(eval(input()))
n = 2 * 10**5
table = [2] * (n + 1)
table[1] = 1
for i in range(2, n // 2 + 1):
    for j in range(2 * i, n + 1, i):
        table[j] += 1
for i in range(x, n + 1):
    if table[i] == 2:
        print(i)
        exit()

-def prime(a): -    for i in range(2, a): -        if a % i == 0: -            return False -    return True - - -while prime(x) == False: -    x += 1 -print(x) +n = 2 * 10**5 +table = [2] * (n + 1) +table[1] = 1 +for i in range(2, n // 2 + 1): +    for j in range(2 * i, n + 1, i): +        table[j] += 1 +for i in range(x, n + 1): +    if table[i] == 2: +        print(i) +        exit()