x = int(eval(input()))





def prime_factorize(n):

    r = []

    while n % 2 == 0:

        r.append(2)

        n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            r.append(f)

            n //= f

        else:

            f += 2

    if n != 1:

        r.append(n)

    return r





for i in range(x, x+100):

    l = prime_factorize(i)

    if i in l:

        l.remove(i)

    if not l:

        print(i)

        exit()
x = int(eval(input()))





def isPrime(n):

    if n == 2:

        return True

    if n % 2 == 0:

        return False

    m = int(n**0.5)+1

    for p in range(3, m, 2):

        if n % p == 0:

            return False

    return True





while not isPrime(x):

    x += 1

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


def prime_factorize(n):
    r = []
    while n % 2 == 0:
        r.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            r.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        r.append(n)
    return r


for i in range(x, x + 100):
    l = prime_factorize(i)
    if i in l:
        l.remove(i)
    if not l:
        print(i)
        exit()

x = int(eval(input()))


def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    m = int(n**0.5) + 1
    for p in range(3, m, 2):
        if n % p == 0:
            return False
    return True


while not isPrime(x):
    x += 1
print(x)

-def prime_factorize(n): -    r = [] -    while n % 2 == 0: -        r.append(2) -        n //= 2 -    f = 3 -    while f * f <= n: -        if n % f == 0: -            r.append(f) -            n //= f -        else: -            f += 2 -    if n != 1: -        r.append(n) -    return r +def isPrime(n): +    if n == 2: +        return True +    if n % 2 == 0: +        return False +    m = int(n**0.5) + 1 +    for p in range(3, m, 2): +        if n % p == 0: +            return False +    return True -for i in range(x, x + 100): -    l = prime_factorize(i) -    if i in l: -        l.remove(i) -    if not l: -        print(i) -        exit() +while not isPrime(x): +    x += 1 +print(x)