import bisect

x = int(eval(input()))



def get_prime(n):

  if n <= 1: return []

  limit = int(n**0.5)

  prime = [2]

  data = [i+1 for i in range(2,n,2)]

  while limit >= data[0]:

    prime.append(data[0])

    data = [j for j in data if j % data[0] != 0]

  return prime + data



l = get_prime(10**5+3)

i = bisect.bisect_right(l, x)

if l[i-1] == x: print(x)

else: print((l[i]))
x = int(eval(input()))



def is_prime(n):

  if n <= 1: return False

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

    if n % i == 0: return False

  return True



if not is_prime(x):

  while not is_prime(x):

    x += 1

print(x)
import bisect

x = int(eval(input()))


def get_prime(n):
    if n <= 1:
        return []
    limit = int(n**0.5)
    prime = [2]
    data = [i + 1 for i in range(2, n, 2)]
    while limit >= data[0]:
        prime.append(data[0])
        data = [j for j in data if j % data[0] != 0]
    return prime + data


l = get_prime(10**5 + 3)
i = bisect.bisect_right(l, x)
if l[i - 1] == x:
    print(x)
else:
    print((l[i]))

x = int(eval(input()))


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


if not is_prime(x):
    while not is_prime(x):
        x += 1
print(x)

-import bisect - -def get_prime(n): +def is_prime(n): -        return [] -    limit = int(n**0.5) -    prime = [2] -    data = [i + 1 for i in range(2, n, 2)] -    while limit >= data[0]: -        prime.append(data[0]) -        data = [j for j in data if j % data[0] != 0] -    return prime + data +        return False +    for i in range(2, int(n**0.5) + 1): +        if n % i == 0: +            return False +    return True -l = get_prime(10**5 + 3) -i = bisect.bisect_right(l, x) -if l[i - 1] == x: -    print(x) -else: -    print((l[i])) +if not is_prime(x): +    while not is_prime(x): +        x += 1 +print(x)