Problem:
 Score: 300 points    Problem Statement  Find the minimum prime number greater than or equal to X .      Notes  A prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.  For example, 2 , 3 , and 5 are prime numbers, while 4 and 6 are not.      Constraints   2 \le X \le 10^5  All values in input are integers.         Input  Input is given from Standard Input in the following format:  X       Output  Print the minimum prime number greater than or equal to X .        Sample Input 1 20      Sample Output 1 23  The minimum prime number greater than or equal to 20 is 23 .       Sample Input 2 2      Sample Output 2 2  X itself can be a prime number.       Sample Input 3 99992      Sample Output 3 100003

Solution (Python):
import math

X = int(input())


def isPrime(num):
    
    if num < 2: return False
    
    elif num == 2: return True
    
    elif num % 2 == 0: return False

    
    
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    
    return True


def callIsPrime(input_num=1000):
    numbers = []
    
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    
    return numbers

l = callIsPrime(100004)

for i in range(len(l)):
    if l[i] >= X:
        print(l[i])
        break

Solution (Python):

def prime(n):
  cnt = 0
  for i in range(1,n):
    if n % i == 0:
        cnt += 1
  if cnt == 1:
    return n
  else:
    return -1

x = int(input())
for i in range(x,2*10**5):
  if prime(i) != -1:
    print(prime(i))
    exit()

Solution (Python):
X = int(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
for i in range(2,100004):
    if i >= X and is_prime(i) == True:
        print(i)
        break

Solution (Python):

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

X  = int(input())
while True:
    if is_prime(X):
        print(X)
        break
    else:
        X += 1

Solution (Python):
import math
import sys

def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []
    time = 0
    
    while True:
        prime = min(A)
        
        if prime > math.sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

X = int(input())
for i in eratosthenes(100003):
    if i >= X:
        print(i)
        sys.exit()

Solution (Python):
X=int(input())
while 1:
    Judge=0
    for i in range(2, X):
        if X%i==0:
            Judge=1
            break
    
    if Judge:
        X+=1
    else:
        break

print(X)

Solution (Python):
x = int(input())
while True:
    judge = False
    for i in range(2, x):
        if x % i == 0:
            judge = True
            break
    if judge:
        x += 1
    else:
        break
print(x)

Solution (Python):
x = int(input())
while True:
    n = 0
    for i in range(2, x):
        if x % i == 0:
            n += 1
    if n != 0:
        x += 1
    else:
        break
print(x)

Solution (Python):
x=int(input())
count=0

n=1
while True:
	n+=1
	ans=True
	for i in range(2,int(x**0.5)):
		if n%i==0:
			ans=False
			break
	if ans and n>=x:
		print(n)
		break

Solution (Python):

X = int(input())


n = X 
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)

n = X *2
primes_bai = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes_bai.difference_update(range(i*2, n+1, i))
primes_bai=list(primes_bai)


X_koetasaisyo = set(primes_bai) - set(primes) 
X_koetasaisyo_list = list(X_koetasaisyo)
X_koetasaisyo_list.append(primes[-1])
X_koetasaisyo_list.sort()

if X == X_koetasaisyo_list[0]: 
    print(X_koetasaisyo_list[0])
else:
    print(X_koetasaisyo_list[1])

Solution (Python):
import bisect

n = 10**5+100
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)

x=int(input())
y=bisect.bisect_left(primes,x)
print(primes[y])

Solution (Python):
def judge(x):
    for i in range(2, int(x**0.5)+1):
        if x % i == 0:
            return False
    return True

x = int(input())
while True:
    if judge(x):
        print(x)
        break
    x += 1

Solution (Python):
x = int(input())

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

if x != 2:
    x = x + 1 - x % 2
while not judge_prime(x):
    x += 2
print(x)

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

x = int(input())
while not is_prime(x):
    x += 1
print(x)

Solution (Python):
def is_prime(x):
    if x<= 1: return False
    i=2
    while i*i<=x:
        if x%i==0:
            return False
        i+=1
    return True

ans = int(input())
while not is_prime(ans):
    ans+=1
print(ans)

Solution (Python):
import math
n=int(input())
if n ==2:
  print(n)
  exit()

w=math.ceil(math.sqrt(n))
for k in range(n,1000000):
  f=False
  for i in range(2,w+1):
    if k%i==0:
      f=True
      break
  if not f:
    print(k)
    exit()

Solution (Python):
def primes(n):
    i = 1
    p = [2]
    while i+2 <= n:
        flag = True
        i += 2
        for j in range(3, int(i**(1/2))+1, 2):
            if i % j == 0:
                flag = False
                break
        if flag:
            p.append(i)
    return p
            
n = int(input())
p = primes(10**5+10)
print([i for i in p if i >= n][0])

Solution (Python):
import bisect


def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = is_prime[1] = False

    for i in range(2, n+1):
        if is_prime[i]:
            for j in range(2 * i, n + 1, i):
                is_prime[j] = False

    table = [i for i in range(1, n + 1) if is_prime[i]]
    return is_prime, table


_, prime_table = sieve(10**5 + 4)

x = int(input())
print(prime_table[bisect.bisect_left(prime_table, x)])

Solution (Python):
x=int(input())

def eratosthenes(n):
    prime_check=[True for _ in range(100010)]
    prime_check[0]=False
    prime_check[1]=False
    for i in range(2,n+1):
        j=2
        while(i*j<=n):
            prime_check[i*j]=False
            j+=1
        if(i*j<100010):
            prime_check[i*j]=False
    return prime_check


p=eratosthenes(x)
i=x
while(True):
    if(p[i]):
        print(i)
        break
    else:
        i+=1

Solution (Python):
import math


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


x = int(input())
ans = float('inf')

for i in range(x, 100004):
    if is_prime(i):
        print(i)
        break

Solution (Python):
import math
x = int(input())

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

for i in range(x, 100004):
  if is_prime(i):
    print(i)
    break

Solution (Python):
import math
import sys
input = sys.stdin.readline

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

def main():
    X = int(input())
    for i in range(X, 100004):
        if is_prime(i):
            print(i)
            break

if __name__ == '__main__': main()

Solution (Python):
def isPrime(x):
    if x <= 1: return False
    i = 2
    while i ** 2 <= x:
        if x % i == 0: return False
        i += 1
    return True

a = int(input())
while True:
    if isPrime(a):
        print(a)
        break
    a += 1

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect




from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  x = int(input())
  prime = [True]*(x*2)
  prime[0] = False
  prime[1] = False
  for i in range(2, x):
    if prime[i]==True:
      baisu = i + i
      while baisu<2*x:
        prime[baisu]=False
        baisu += i
  for i in range(x,2*x):
    if prime[i]==True:
      print(i)
      break
  
  
if __name__ == '__main__':
  main()

Solution (Python):
import math
X = int(input())
for i in range(X, 1000000):
  goseisu = False
  for j in range(2, X):
    if i % j == 0:
      goseisu = True
      break
  if not goseisu:
    print(i)
    exit()

Solution (Python):
import math
X = int(input())
 
if X == 2:
  print(2)
  exit()
  
hajime = X
 



for i in range(hajime, 1000000):
  goseisu = False
  for j in range(2, hajime):
    if i % j == 0:
      goseisu = True
      break
  if not goseisu:
    print(i)
    exit()

Solution (Python):
import math
X = int(input())
 
if X == 2:
  print(2)
  exit()
  
hajime = X
 
if hajime % 2 == 0:
  hajime += 1
checkMax = math.ceil(math.sqrt(hajime))
for i in range(hajime, 1000000):
  goseisu = False
  for j in range(2, checkMax + 1):
    if i % j == 0:
      goseisu = True
      break
  if not goseisu:
    print(i)
    exit()

Solution (Python):
import math
X = int(input())
 
if X == 2:
  print(2)
  exit()
  
hajime = X
 
if hajime % 2 == 0:
  hajime += 1
checkMax = math.ceil(math.sqrt(hajime))
for i in range(hajime, 1000000, 2):
  goseisu = False
  for j in range(2, checkMax + 1):
    if i % j == 0:
      goseisu = True
      break
  if not goseisu:
    print(i)
    exit()

Solution (Python):
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

x = int(input())

while True:
    if is_prime(x):
        break
    x += 1

print(x)

Solution (Python):
x = int(input())

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

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

Solution (Python):
x = int(input())
while any(x%i<1 for i in range(2,int(x**0.5)+1)):
  x+=1
print(x)

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    while True:
        if fc(N):
            print(N)
            exit()
        N += 1


if __name__ == '__main__':
    main()

Solution (Python):
x=int(input())
arr=set(range(2,x))
for i in range(2,int(x**0.5)+1):
  arr.difference_update(range(2*i,x,i))
res=True
x-=1
while res:
  res=False
  x+=1
  for i in arr:
    if x%i==0:
      res=True
      break
print(x)

Solution (Python):
import math
x = int(input())
ans = x

while True:
    d = True
    for i in range(2,int(ans**0.5)+1):
        if ans%i == 0:
            d = False
    if d:
        print(ans)
        exit()
    else:
        ans += 1

Solution (Python):
X = int(input())
def is_prime(n):
    if n == 2:
        return True
    elif n%2 == 0:
        return False
    if pow(2, n-1, n) != 1:
        return False
    return True

n = X-1
primes = []
while True:
    n += 1
    if is_prime(n):
        flag = True
        for p in range(3, n//2):
            if n%p == 0:
                flag = False
                break
        if flag:
            primes.append(n)
            if n >= X:
                print(n)
                break

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    x = int(input())

    def prime_decomp(n):
        i = 2
        res = []
        while i ** 2 <= n:
            while n % i==0:
                n //= i
                res.append(i)
            i += 1
        if n > 1:
            res.append(n)
        return res

    while 1:
        if len(prime_decomp(x))==1:
            print(x)
            exit()
        else:
            x += 1

if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
while 1:
    i = 2
    flag = True
    while i*i<X:
        if X%i==0:
            flag = False
            break
        i+=1
    if flag:
        break
    X+=1
print(X)

Solution (Python):
import math
X=int(input())

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

while True:
    if sosu(X):
        print(X)
        break
    X+=1

Solution (Python):
import math
x=int(input())
for i in range(x,100004):
    flag=True
    for j in range(2,math.floor(math.sqrt(i))+1):
        if i%j==0:
            flag=False
            break
    if flag:
        print(i)
        exit(0)

Solution (Python):
N = int(input())
x = True
while x:
    num = 2
    while N % num != 0:
        num += 1
    if num == N:
        x = False
    else:
        N += 1
print(N)

Solution (Python):
x = int(input())

def is_prime(q):
    import math
    if q == 1:
        return False
    for k in range(2,int(math.sqrt(q)) + 1):
        if q % k == 0:
            return False
    return True

while True:
    if is_prime(x):
        print(x)
        exit()
    x += 1

Solution (Python):
x = int(input())

ju = True

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

while(is_prime(x)!=True):
    x += 1
print(x)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

X = ir()

def check(n):
    if X == 2:
        return True
    if n % 2 == 0:
        return False
    f = 3
    while f * f <= n:
        if n % f == 0:
            return False
        else:
            f += 2
    return True

while True:
    if check(X):
        print(X); exit()
    else:
        X += 1

Solution (Python):
n = int(input())
for i in range(n, 2 * n):
    cnt = 0
    for j in range(2, int(i ** 0.5) + 1):
        if i % j != 0:
            cnt += 1
    
    if cnt == int(i ** 0.5) - 1:
        print(i)
        break

Solution (Python):
def prim():
 a=int(input())
 
 l1=[]
 for j in range(0,a):
  for i in range(2,a+j):
      l1.append((a+j)%i)
  if 0 not in l1:
      return a+j
  l1=[]
  
print(prim())

Solution (Python):
import math
n=int(input())
def prime_judge(n):
  if n == 2:
    return True
  if n < 2 or n % 2 == 0:
    return False
  for i in range(3, int(math.sqrt(n)) + 1, 2):
    if n % i == 0:
      return False
  return True

while prime_judge(n)==False:
  n+=1
print(n)

Solution (Python):
import math

X = int(input())

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

while 1:
  if isPrime(X):
    print(X)
    break
  X += 1

Solution (Python):



import math

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


def main():
    X = int(input())

    while(True):
        if is_prime(X):
            break
        X += 1
    
    print(X)


if __name__ == '__main__':
    main()

Solution (Python):
def resolve():
    N = int(input())

    def is_prime(x):
        i = 2
        while i**2 < x:
            if not x % i:
                return False
            i += 1
        return True

    x = N
    while not is_prime(x):
        x += 1
    print(x)
    
resolve()

Solution (Python):
n = int(input())
 
flag = 0
 
while flag==0:

	tst = 2
	while n % tst != 0:
		tst = tst + 1
	if tst==n: 
		flag=1
	else:
		n=n+1
print(n)

Solution (Python):
x=int(input())
i=2
cond="notyet"
while cond=="notyet":
    count=0
    for i in range(2,x):
        ex=x%i
        if  ex!=0:
            count+=1
    if count==x-2:
        ans=x
        cond="discovered"
    else:
        x=x+1
print(ans)

Solution (Python):
x = int(input())

def is_prime(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

for i in range(x, 10 ** 9):
    if is_prime(i):
        print(i)
        exit()

Solution (Python):
a = int(input())
b = True
def hantei(n, x): 
    for i in range(2, n):
        if n % i == 0:
            x = True
            return x
while b:
    b = hantei(a, b)
    if b is None:
        print(a)
        break
    a += 1

Solution (Python):
a = int(input())
def hantei(x):
    k = 0
    for i in range(2, x//2):
        if x % i == 0:
            k += 1
    if k ==0:
        return x

c = True
while c:
    hantei(a)
    b = hantei(a)
    if b is not None:
        print(b)
        c = False
    elif b is None:
        a += 1

Solution (Python):
def is_prime(x):
    i = 2
    while i*i <= x:
        if x%i == 0: return False
        i += 1
    return x != 1


x = int(input())
while True:
    if is_prime(x):
        print(x)
        break
    x += 1

Solution (Python):
n = 100003
a = [False]*2 + [True]*(n-1)
for i in range(2, int(n**.5)+1):
    if not a[i]:
        continue
    for j in range(i*2, n+1, i):
        a[j] = False
b = [i for i in range(n+1) if a[i]]

x = int(input())
print(min(i for i in b if i>=x))

Solution (Python):
def main():
	x = int(input())
	while not IsPrime(x):
		x += 1
	print(x)

def IsPrime(n):
	if n < 2:
		return False
	elif n == 2:
		return True
	elif n % 2 == 0:
		return False
	
	sqrtN = int(n**0.5)
	for i in range(3, sqrtN, 2):
		if n%i == 0:
			return False
	return True

if __name__ == '__main__':
	main()

Solution (Python):

X = int(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 True:
    if isPrime(X)==True:
        print(X)
        break
    else:
        X+=1

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

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

Solution (Python):
def is_prime(x):
    if x <= 1:
        return False
    for i in range(2, x + 1):
        if i * i > x:
            break
        if x % i == 0:
            return False
    return True


x = int(input())
while not is_prime(x):
    x += 1
print(x)

Solution (Python):
X=int(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

for i in range(X,1000000):
    if is_prime(i):
        print(i)
        break

Solution (Python):
x=int(input())
import math
def is_prime(n):
    if n==1:
        return False
    for divisor in range(2,int(math.sqrt(n))+1):
        if n%divisor == 0:
            return False
    return True

k=0
while True:
    if is_prime(x+k):
        print(x+k)
        break
    else:
        k += 1

Solution (Python):
from math import ceil,sqrt
def prime_judge(n):
    if n==2:
        return True
    if n<2 or n%2==0:
        return False
    for i in range(3,int(ceil(sqrt(n)))+1,2):
        if n%i==0:
            return False
    return True

x=int(input())
while not prime_judge(x):
    x+=1
print(x)

Solution (Python):
X = int(input())

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


for i in primes(1000000):
    if i >= X:
        print(i)
        break

Solution (Python):
x = int(input())
flag = 0

def judge(x):
    count = 0
    for i in range(1,x+1):
        if x%i == 0:
            count +=1

    return count

while (1):
    if judge(x) == 2:
        print(x)
        break
    else:
        x = x+1

Solution (Python):
import math
x = int(input())


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

for i in range(x, 2*10**5):
    if is_prime(i) == True:
        print(i)
        exit()

Solution (Python):
X = int(input())
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

tmp = primes(2*X)

for i in range(len(tmp)):
    if tmp[i]>X:
        print(tmp[i])
        break
    elif tmp[i]==X:
        print(X)
        break

Solution (Python):
X = int(input())
if X == 2:
    print(2)
else:
    for i in range(X, 10**6):
        if i%2 == 0:
            continue
        else:
            for j in range(3, int(i**0.5)+1, 2):
                if i%j == 0:
                    break
            else:
                break

    print(i)

Solution (Python):
import math

def isPrime(n):
    for i in range(math.floor(n ** (1/2))):
        i += 1
        if i == 1:
            pass
        elif n % i == 0:
            return False
            break
    else:
        return True
      
n = int(input())

while True:
    
    if isPrime(n):
        print(n)
        break
    
    n += 1

Solution (Python):
import math

x = int(input())
y = 0

if x==2: 
  print(2)
  
else: 
  while y == 0: 
    for k in range(2, int(math.sqrt(x)) + 1): 
      if x % k == 0: 
        x = x + 1 
        break 
      if k == int(math.sqrt(x)):
        y = 1
  print(x)

Solution (Python):
from sys import exit
from math import sqrt

x = int(input())
if x == 2:
    print(2)
    exit()
elif x == 3:
    print(3)
    exit()
i = x
while i <= x * int(sqrt(x)):
    j = 2
    while j <= int(sqrt(i)):
        if not i % j:
            break
        j += 1
    if j > int(sqrt(i)):
        print(i)
        exit()
    i += 1

Solution (Python):
import math
X  = int(input())

def check(n):
    for i in range(2, math.ceil(math.sqrt(n))+1):
        
        if n%i==0:
            break
    else:
        return 1

if X==2:
    print(2)
else:
    for i in range(X, X+100):
        
        if check(i)==1:
            print(i)
            break

Solution (Python):
import math

X = int(input())

for i in range(X,2*X,1):
  for j in range(2,math.floor(i**0.5)+1,1):
    if i % j == 0:
      break
  else:
    print(i)
    break

Solution (Python):
import math
X = int(input())
flag = False
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
i = 0
while flag != True:
    flag = is_prime(X+i)
    i += 1
print(X+i-1)

Solution (Python):
x = int(input())

s =[2]

if x==2:
    print(x)
    exit()
else:
    for i in range(3,int(x/2),2):
        if all(i%k!=0 for k in s):
            s.append(i)

while any(x%k==0 for k in s):
  x+=1
else:
  print(x)

Solution (Python):
X=int(input())
while(1):
    if all(X%i for i in range(2,int(X**0.5)+1)):
        print(X)
        break
    X+=1

Solution (Python):
import math

def check_prime(a):
    b = True
    for i in range(2,int(math.sqrt(a))):
        if a % i==0:
            b = False
            break
    if a==2:b = True
    return b      
a=int(input())
while True:
    if check_prime(a):
        print(a)
        break
    a += 1

Solution (Python):
X = int(input())

primes = list(range(2 * X + 1))
primes[1] = 0

for prime in primes:
    if prime > (2*X)**0.5:break
    if prime == 0:continue
    for non_prime in range(2 * prime, 2*X+1, prime):
        primes[non_prime] = 0
lst = [prime for prime in primes if prime != 0]

for i in lst:
    if i>=X:
        print(i)
        break

Solution (Python):
from math import sqrt

MAX = 10**5 + 10
x = int(input())

nums = [i for i in range(1, MAX)]

for i in range(2, int(sqrt(MAX))+1):
    nums = [j for j in nums if j % i != 0 or j == i]
l = 0
r = len(nums)-1
while r - l > 1:
    mid = (r + l)//2
    if nums[mid] <= x:
        l = mid
    else:
        r = mid
if nums[l] == x:
    print(x)
else:
    print(nums[r])

Solution (Python):
import math

n=int(input())

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

for i in range (n,100004):
  if (check(i)=="True"):
    print(i)
    break

Solution (Python):
import sys
import math

x=int(input())

for i in range(x,200000):
    flag = True
    tmp = math.floor(math.sqrt(i))
    for k in range(2,tmp):
        if i%k == 0:
            flag = False
    if flag:
        print(i)
        sys.exit()

Solution (Python):
x = int(input())
while True:
    p = True
    for i in range(2, int(x**0.5)+1):
        if x % i == 0:
            p = False
            break
    if p:
        break
    x += 1
print(x)

Solution (Python):
import math
X = int(input())
ans = 0
for i in range(X,X+100):
  for j in range(2,int(math.sqrt(i))):
    if i % j == 0:
      ans += 1
  if ans == 0:
    print(i)
    exit()
  ans = 0

Solution (Python):
import math

N=int(input())

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

while True:
    if is_prime(N)==True:
        print(N)
        break
    N+=1

Solution (Python):
x = int(input())

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

while True:
    if is_prime(x):
        print(x)
        break
    x += 1

Solution (Python):
x = int(input())

ans = x
while (1):
    ok = True
    for i in range(2, ans):
        if ans % i == 0:
            ok = False
            break
    if ok:
        print(ans)
        exit()
    else:
        ans += 1

Solution (Python):
p = int(input())
n = 2*p
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)
primes.sort()

for i in primes:
    if i >= p:
        print(i)
        break

Solution (Python):
x=int(input())
p=x**0.5
while any(x%i==0 for i in range(2,int(p)+1)):
  x+=1
else:
  print(x)

Solution (Python):
x=int(input())
a=0
i=x
t=0
ans=0
while t==0:
	a=0 
	for k in range(2,round(i**0.5)+1):
		if i%k==0:
			a=a+1
	if a==0:
		t=i
	i=i+1
print(t)

Solution (Python):
def search_num(X):
    ans=1
    for i in range(2,X):
        if X%i==0:
            ans*=2
    if ans%2!=0:
        return X
    else:
        return search_num(X+1)
X=int(input())
print(search_num(X))

Solution (Python):
X = int(input())

candidate = X
prime = False

if candidate == 2:
    prime = True

while prime != True:
    for i in range(2, int(candidate ** 0.5) + 2):
        if candidate % i == 0:
            candidate += 1
            break
    else:
        prime = True

print(candidate)

Solution (Python):
X = int(input())

while True:
    i = 2
    while i * i <= X: 
        if X % i == 0:
            break     
        i += 1        
    else:
        print(X)      
        break
    X += 1

Solution (Python):
X = int(input())
judge = ""

if X == 2:
    print(2)
else:
    while judge != "prime":
        for i in range(2, X):
            if X % i == 0:
                judge = "com"
                X += 1
                break
            else:
                judge = "prime"
    print(X)

Solution (Python):
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return is_prime

x = int(input())
p = primes(10**6)

while True:
    if p[x]:
        break
    else:
        x += 1
print(x)

Solution (Python):
n = int(input())

def prime_or(num):
    mx = int(num**(1/2))
    
    for i in range(2,mx):
        if(num%i == 0):
            return 0
    
    return 1
    
flag = 0
st = n
while True:
    if(prime_or(st)==1):
        print(st)
        break
    else:
        st += 1

Solution (Python):
def factorize(n):
    result = []
    tmp = n
    for k in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while tmp % k == 0:
            cnt += 1
            tmp //= k
        if cnt > 0:
            result.append([k, cnt])
    if tmp != 1:
        result.append([tmp, 1])
    return result

x = int(input())

while True:
    f = factorize(x)
    if len(f) == 1:
        if f[0][1] == 1:
            print(x)
            break
    x += 1

Solution (Python):
x = int(input())
if x == 2:
  print(2)
  exit()
for i in range(x,2*x):
  for j in range(2,x-1):
    if x % j == 0:
      x += 1
      break
    elif j == x-2:
      print(x)
      exit()

Solution (Python):
X = int(input())

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


while True:
    if sosu(X):
        print(X)
        break
    else:
        X += 1

Solution (Python):
import math
n = int(input())
def is_prime(n):
  for i in range(2,int(math.sqrt(n))+1):
    if n % i == 0:
      return False
  return True
for i in range(n,2*10**5):
  if is_prime(i):
    print(i)
    exit()

Solution (Python):
x=int(input())



import math

while True:
    flag=True
    for i in range(2,int(math.sqrt(x))+1):
        if x%i==0:
            flag=False
            break    
    if flag:
        break
    else:
        x+=1
print(x)

Solution (Python):
import math
X = int(input())
for i in range(X, 2*X):
  frag = False
  for j in range(2, math.ceil(math.sqrt(i))):
    if i % j != 0:
      continue
    else:
      break
  else:
    print(i)
    frag = True
  if frag:
    break

Solution (Python):
X=int(input())
def chk_prime(x):
    for i in range(2,int(pow(x,0.5))+1):
        if x%i==0:
            return False
    return True

while not chk_prime(X):
    X+=1
print(X)

Solution (Python):
def is_prime(x):
  if x < 2:
    return False
  if x == 2 or x == 3 or x == 5:
    return True
  if x % 2 == 0 or x % 3 == 0 or x % 5 == 0:
    return False
  prime = 7
  step = 4
  while prime <= pow(x, 1/2):
      if x % prime == 0:
        return False
      prime += step
      step = 6 - step
  return True


res = int(input())
p = res
flg = 0
while flg == 0:
  if is_prime(p) and p >= res:
    res = p
    flg = 1
  p += 1
print(res)