x = int(eval(input()))

flg = 0

def isPrimenum(n):

	if n < 2:

		return False

	if n == 2:

		return True

	for p in range(2, n):

		if n % p == 0:

			return False

	return True

while flg == 0:

	if isPrimenum(x) == True:

		flg = 1

		break

	x += 1

print (x)

import math

n = int(eval(input()))



def check(s):

	if s == 1:

		return False

	for i in range(2, int(math.sqrt(s)) + 1):

		if s%i == 0:

			return False

	return True



for i in range(n,10**6):

	if check(i):

		print (i)

		exit()

x = int(eval(input()))
flg = 0


def isPrimenum(n):
    if n < 2:
        return False
    if n == 2:
        return True
    for p in range(2, n):
        if n % p == 0:
            return False
    return True


while flg == 0:
    if isPrimenum(x) == True:
        flg = 1
        break
    x += 1
print(x)

import math

n = int(eval(input()))


def check(s):
    if s == 1:
        return False
    for i in range(2, int(math.sqrt(s)) + 1):
        if s % i == 0:
            return False
    return True


for i in range(n, 10**6):
    if check(i):
        print(i)
        exit()

-x = int(eval(input())) -flg = 0 +import math + +n = int(eval(input())) -def isPrimenum(n): -    if n < 2: +def check(s): +    if s == 1: -    if n == 2: -        return True -    for p in range(2, n): -        if n % p == 0: +    for i in range(2, int(math.sqrt(s)) + 1): +        if s % i == 0: -while flg == 0: -    if isPrimenum(x) == True: -        flg = 1 -        break -    x += 1 -print(x) +for i in range(n, 10**6): +    if check(i): +        print(i) +        exit()