x = int(eval(input()))



def is_prime(n):

    if n <= 1:

        return False

    for i in range(2, x):

        if x%i == 0:

            return False

    return True



while is_prime(x) == False:

    x += 1



print(x)
import math



x = int(eval(input()))



def is_prime(n):

    if n <= 1:

        return False

    for i in range(2, int(math.sqrt(x))):

        if x%i == 0:

            return False

    return True



while is_prime(x) == False:

    x += 1



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


def is_prime(n):
    if n <= 1:
        return False
    for i in range(2, x):
        if x % i == 0:
            return False
    return True


while is_prime(x) == False:
    x += 1
print(x)

import math

x = int(eval(input()))


def is_prime(n):
    if n <= 1:
        return False
    for i in range(2, int(math.sqrt(x))):
        if x % i == 0:
            return False
    return True


while is_prime(x) == False:
    x += 1
print(x)

+import math + -    for i in range(2, x): +    for i in range(2, int(math.sqrt(x))):