import sys



import numpy as np

def sieve_of_eratosthenes(n=5 * 10 ** 7):

  sieve = np.ones(n + 1); sieve[:2] = 0

  for i in range(2, int(np.sqrt(n)) + 1):

    if sieve[i]: sieve[i*2::i] = 0

  return sieve, np.flatnonzero(sieve)



is_prime, prime_numbers = sieve_of_eratosthenes()



def prime_factorize(n):

  res = dict()

  if n < 2: return res

  border = int(n ** 0.5)

  for p in prime_numbers:

    if p > border: break

    while n % p == 0: res[p] = res.get(p, 0) + 1; n //= p

    if n == 1: return res

  res[n] = 1

  return res



def prime_factorize_factorial(n):

  res = dict()

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

    for p, c in list(prime_factorize(i).items()): res[p] = res.get(p, 0) + c

  return res



x = int(sys.stdin.readline().rstrip())



def main():

    i = np.searchsorted(prime_numbers, x, side='left')

    print((prime_numbers[i]))



if __name__ ==  '__main__':

    main()
import sys

from bisect import bisect_left as bi_l



def sieve_of_eratosthenes(n=5 * 10 ** 6):

  sieve = [1] * (n + 1); sieve[0] = sieve[1] = 0

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

    if not sieve[i]: continue

    for j in range(i * 2, n + 1, i): sieve[j] = 0

  prime_numbers = [i for i in range(2, n + 1) if sieve[i]]

  return sieve, prime_numbers



is_prime, prime_numbers = sieve_of_eratosthenes()



def prime_factorize(n):

  res = dict()

  if n < 2: return res

  border = int(n ** 0.5)

  for p in prime_numbers:

    if p > border: break

    while n % p == 0: res[p] = res.get(p, 0) + 1; n //= p

    if n == 1: return res

  res[n] = 1

  return res



def prime_factorize_factorial(n):

  res = dict()

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

    for p, c in list(prime_factorize(i).items()): res[p] = res.get(p, 0) + c

  return res



x = int(sys.stdin.readline().rstrip())



def main():

    i = bi_l(prime_numbers, x)

    print((prime_numbers[i]))



if __name__ ==  '__main__':

    main()
import sys
import numpy as np


def sieve_of_eratosthenes(n=5 * 10**7):
    sieve = np.ones(n + 1)
    sieve[:2] = 0
    for i in range(2, int(np.sqrt(n)) + 1):
        if sieve[i]:
            sieve[i * 2 :: i] = 0
    return sieve, np.flatnonzero(sieve)


is_prime, prime_numbers = sieve_of_eratosthenes()


def prime_factorize(n):
    res = dict()
    if n < 2:
        return res
    border = int(n**0.5)
    for p in prime_numbers:
        if p > border:
            break
        while n % p == 0:
            res[p] = res.get(p, 0) + 1
            n //= p
        if n == 1:
            return res
    res[n] = 1
    return res


def prime_factorize_factorial(n):
    res = dict()
    for i in range(2, n + 1):
        for p, c in list(prime_factorize(i).items()):
            res[p] = res.get(p, 0) + c
    return res


x = int(sys.stdin.readline().rstrip())


def main():
    i = np.searchsorted(prime_numbers, x, side="left")
    print((prime_numbers[i]))


if __name__ == "__main__":
    main()

import sys
from bisect import bisect_left as bi_l


def sieve_of_eratosthenes(n=5 * 10**6):
    sieve = [1] * (n + 1)
    sieve[0] = sieve[1] = 0
    for i in range(2, int(n**0.5) + 1):
        if not sieve[i]:
            continue
        for j in range(i * 2, n + 1, i):
            sieve[j] = 0
    prime_numbers = [i for i in range(2, n + 1) if sieve[i]]
    return sieve, prime_numbers


is_prime, prime_numbers = sieve_of_eratosthenes()


def prime_factorize(n):
    res = dict()
    if n < 2:
        return res
    border = int(n**0.5)
    for p in prime_numbers:
        if p > border:
            break
        while n % p == 0:
            res[p] = res.get(p, 0) + 1
            n //= p
        if n == 1:
            return res
    res[n] = 1
    return res


def prime_factorize_factorial(n):
    res = dict()
    for i in range(2, n + 1):
        for p, c in list(prime_factorize(i).items()):
            res[p] = res.get(p, 0) + c
    return res


x = int(sys.stdin.readline().rstrip())


def main():
    i = bi_l(prime_numbers, x)
    print((prime_numbers[i]))


if __name__ == "__main__":
    main()

-import numpy as np +from bisect import bisect_left as bi_l -def sieve_of_eratosthenes(n=5 * 10**7): -    sieve = np.ones(n + 1) -    sieve[:2] = 0 -    for i in range(2, int(np.sqrt(n)) + 1): -        if sieve[i]: -            sieve[i * 2 :: i] = 0 -    return sieve, np.flatnonzero(sieve) +def sieve_of_eratosthenes(n=5 * 10**6): +    sieve = [1] * (n + 1) +    sieve[0] = sieve[1] = 0 +    for i in range(2, int(n**0.5) + 1): +        if not sieve[i]: +            continue +        for j in range(i * 2, n + 1, i): +            sieve[j] = 0 +    prime_numbers = [i for i in range(2, n + 1) if sieve[i]] +    return sieve, prime_numbers -    i = np.searchsorted(prime_numbers, x, side="left") +    i = bi_l(prime_numbers, x)