CodeEff/ECCO huggingface dataset:
# Original solution
X = int(eval(input()))
flag = 0

while flag ==0:
	if X==2:
		X+=1
		break
	for i in range(X-2):
		if X%(i+2)==0:
			break
		if i+3==X:
			flag = 1
			break
	X +=1

print((X-1))

# Optimized solution
X=int(eval(input()))
flag=0

if X==2 or X==3:
	flag=1

while flag==0:
	for k in range(2,int(X**0.5)+1):
		if k==int(X**0.5) and X%k!=0:
			flag=1
		
		if k>2 and k%2==0:
			continue
		elif k>3 and k%3==0:
			continue
		elif X%k==0:
			break
	
	if flag==0:X=X+1	
		
print(X)
# Original solution
import bisect

x = int(eval(input()))

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

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

table = sieve(10**5 + 100)

print((table[bisect.bisect_left(table, x)]))


# Optimized solution
x = int(eval(input()))

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

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

table = sieve(10**5 + 100)

l = 0
r = len(table) - 1

while l <= r:
    m = (l + r) // 2
    if table[m] >= x:
        r = m - 1
    else:
        l = m + 1

print((table[l]))
# Original solution
# -*- coding: utf-8 -*-
"""
Created on Tue Sep  8 20:25:36 2020

@author: liang
"""

def Eratosthenes(x):
    lis = [int(i) for i in range(2,x+1)]
    #print(lis)
    res = list()
    while lis:
        a = lis.pop(0)
        res.append(a)
        lis = [i for i in lis if i%a != 0]
        #print(lis)
    return res

import math
X = int(eval(input()))
N = int(math.sqrt(X))
lis = Eratosthenes(N)
#print(N)
#print(lis)
ans = X 

while True:
    if all(ans%i != 0 for i in lis):
        print(ans)
        break
    ans += 1

# Optimized solution
# -*- coding: utf-8 -*-
"""
Created on Tue Sep  8 20:37:12 2020

@author: liang
"""
import math
X = int(eval(input()))
N = int(math.sqrt(X))
lis = list(range(2,N+1))
#print(N)
#print(lis)
ans = X 

while True:
    if all(ans%i != 0 for i in lis):
        print(ans)
        break
    #print(ans)
    ans += 1
# Original solution
x=int(eval(input()))
s={2}
if x==2:
	print((2))
else:
	for i in range(3,10**6):
		if all(i%j!=0 for j in s):
			s.add(i)
			if i>=x:
				print(i)
				break


# Optimized solution
x=int(eval(input()))
counter=0
while counter==0:
	counter=1
	for i in range(2,x):
		if x%i==0:
			counter=0
	if counter==1:
		print(x)
	else:
		x+=1
# Original solution
x = int(eval(input()))
n = 2
while n<x:
    if x%n == 0:
        x+=1
        n=2
    else:
        n+=1
print(x)

# Optimized solution
x = int(eval(input()))
for y in range(x,2*x):
    for i in range(2, int(y**.5)+1):
        if y%i ==0:
            break
    else:
        print(y)
        break
# Original solution
X = int(eval(input()))
result = False

while result == False:
  result = True
  for i in range(2,-(-X//2)+1):
    if X % i == 0:
      result = False
      break
    else:
      result = True
  if not result:
    X += 1
print(X)


# Optimized solution
X = int(eval(input()))-1
result = False

while not result:
  result = True
  X += 1
  for i in range(2,X//2+1):
    if X % i == 0:
      result = False
      break
print(X)
# Original solution
x = int(eval(input()))
while True:
    is_prime = True
    for i in range(2, x):
        if x % i == 0:
            is_prime = False
            break
    if is_prime:
        print(x)
        break
    x += 1


# Optimized solution
x = int(eval(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)
# Original solution
import sys
import math

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):
    numbers = []
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)
    return numbers


def main():
    
    input = sys.stdin.readline
    x = int(eval(input()))
    primes = callIsPrime(x+1000)
    ans = [i for i in primes if i>=x]
    print((min(ans)))


if __name__ == "__main__":
    main()



# Optimized solution
import sys
import math

def is_prime(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 call_is_prime(n):
    return [i for i in range(1,n) if is_prime(i)]


def main():
    
    input = sys.stdin.readline
    x = int(eval(input()))
    primes = call_is_prime(x+1000)
    ans = [i for i in primes if i>=x]
    print((min(ans)))


if __name__ == "__main__":
    main()
# Original solution
import math
X = int(eval(input()))

if X == 2 or X == 3:
    print(X)
    exit()

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



# Optimized solution

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

    return flag

import math
X = int(eval(input()))

i=0
while 1:
    if is_prime(X+i):
        print((X+i))
        break
    i+=1
# Original solution
N = int(eval(input()))
over_box = [i for i in range(N,10**6)]
primes = [2]
for i in range(3, N, 2):
    all(i % p != 0 for p in primes) and primes.append(i)
for i in over_box:
    if N ==2:
        print((2))
        break
    elif all(i % p != 0 for p in primes):
        print(i)
        break

# Optimized solution
N = int(eval(input()))
box = [i for i in range(N,100004)]
box = [i for i in box if not i % 2==0]
box = [i for i in box if not i % 3==0]
box = [i for i in box if not i % 5==0]
box = [i for i in box if not i % 7==0]
primes = [2]
for i in range(3, N, 2):
    all(i % p != 0 for p in primes) and primes.append(i)
for i in box:
    if N ==2:
        print((2))
        break
    elif all(i % p != 0 for p in primes):
        print(i)
        break
# Original solution
X = int(eval(input()))
if X == 2:
  print((2))
  exit()

num = 3
ps = [2]
while 1:
  flag = True
  for p in ps:
    if num%p == 0:
      flag = False
      break
  if flag:
    ps.append(num)
    if num>=X:
      print(num)
      exit()
  num += 1

# Optimized solution
X = int(eval(input()))
if X == 2:
  print((2))
  exit()

num = 3
ps = [2]
while 1:
  flag = True
  for p in ps:
    if num%p == 0:
      flag = False
      break
  if flag:
    ps.append(num)
    if num>=X:
      print(num)
      exit()
  num += 2
# Original solution
x = int(eval(input()))
a = 2

while True:
    while a <= int(x**0.5//1):
        if x%a == 0: break
        a += 1
    else:
        ans = x
        break
    x += 1
    a = 2

print(ans)

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

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

print(ans)
# Original solution
X = int(eval(input()))

import math

# Mまでの素数全列挙(エラトステネスの篩)
def primes(M):
    is_prime = [-1 for _ in range(M+1)]
    for m in range(2, M+1):
        if is_prime[m] == -1:
            is_prime[m] = 1
            l = 2
            while m*l <= M:
                is_prime[m*l] = 0
                l += 1
    primes = []
    for p in range(2, M+1):
        if is_prime[p] == 1:
            primes.append(p)
    return primes

ps = primes(2*10**5)

for p in ps:
    if p >= X:
        print(p)
        break

# Optimized solution
N = int(eval(input()))

import math

# Mまでの素数全列挙(エラトステネスの篩)
def primes(M):
    is_prime = [-1 for _ in range(M+1)]
    for m in range(2, M+1):
        if is_prime[m] == -1:
            is_prime[m] = 1
            l = 2
            while m*l <= M:
                is_prime[m*l] = 0
                l += 1
    primes = []
    for p in range(2, M+1):
        if is_prime[p] == 1:
            primes.append(p)
    return primes


P = primes(2*N)
ans = -1
for p in P:
    if p >= N:
        ans = p
        break
print(ans)
# Original solution
def is_prime(n):
    if n==1:
        return False
    for i in range(2, int(n**.5)+1):
        if n%i==0:
            return False
    return True

x = int(eval(input()))
for i in range(x, 10**6):
    if is_prime(i):
        print(i)
        break

# Optimized solution
def is_prime(n):
    if n==1:
        return False
    for i in range(2, int(n**.5)+1):
        if n%i==0:
            return False
    return True

x = int(eval(input()))
if x!=2 and x%2==0:
    x+=1
for i in range(x, 10**6, 2):
    if is_prime(i):
        print(i)
        break
# Original solution
import math
X = int(eval(input()))
X -= 1
Flag = True

if X == 1:
  print((2))
  Flag = False

while Flag:
  X += 1
  r = 1
  for i in range(math.ceil(math.sqrt(X)) - 1):
    r += 1
    if X % r == 0:
      break
    if r == math.ceil(math.sqrt(X)):
      print(X)
      Flag = False

# Optimized solution
import math
X = int(eval(input()))
while any(X % i == 0 for i in range(2, int(math.sqrt(X)+1))):
  X += 1
print(X)
# Original solution
def prime(x):
    flag = True
    n = 1
    while(n**2 <=x):
        n += 1
        q,r = divmod(x,n)
        if r==0:
            flag = False
            break
    return flag

def find(x):
    c = x
    while(prime(c)==False):
        c +=2
    return c


x = int(eval(input()))
if x==2:
    print(x)
elif x%2==0:
    print((find(x+1)))
else:
    print((find(x)))

# Optimized solution
def prime(x):
    n = 2
    while(n * n <= x):
        if(x % n ==0):
            return False
        n += 1
    return True      
    
x = int(eval(input()))
while(prime(x)!=True):
    x += 1
    
print(x)
# Original solution
X=int(eval(input()))
ps=[2]
x=2
while ps[-1]<X:
  f=True
  for p in ps:
    if x%p==0:
      f=False
      break
  if f:ps.append(x)
  x+=1
print((ps[-1]))


# Optimized solution
def is_prime(p):
  if p>1:
    for i in range(2,p):
      if p%i==0:return True
  return False

X=int(eval(input()))
p=X
while is_prime(p) != False:p+=1
print(p)
# Original solution
X = int(eval(input()))

fact = [True] * (10 ** 5 + 1000)
fact[0],fact[1] = False,False
for i in range(2,len(fact)):
  if fact[i]:
    for j in range(i * 2, len(fact), i):
      fact[j] = False
      
for i in range(X,len(fact)):
  if fact[i]:
    print(i)
    break

# Optimized solution
X = int(eval(input()))

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

while True:
  if checkfact(X):
    print(X)
    break
  X += 1
# Original solution
x = int(eval(input()))
ok = False

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


# Optimized solution
x = int(eval(input()))
ok = False

while ok == False:
    ok = True
    for i in range(2, int(x/2)):
        if x%i == 0:
            ok = False
            x += 1
            #print("####")
            break
    if ok == True:
        print(x)
        break
# Original solution
x = int(eval(input()))

if x == 1:
    ans = 1
elif x == 2:
    ans = 2
else:    
    num = [3]
    for i in range(3, x, 2):
        for j in num:
            if (i % j) == 0:
                break
        else:
            num.append(i)
    last_num = i
    k = i + 1
    while True:
        for j in num:
            if (k % j) == 0:
                k += 1
                break
        else:
            ans = k
            break
print(ans)

# Optimized solution
# ABC149C
import math

def check_prime(num):
    for i in range(2, math.ceil(math.sqrt(num))):
        if num % i == 0:
            return False
    else:
        return True

x = int(eval(input()))
while True:
    if check_prime(x):
        print(x)
        break
    x += 1
# Original solution
X = int(eval(input()))
prime = [2]
for i in range(3, 100004):
  for p in prime:
    is_prime = True
    if i % p == 0:
      is_prime = False
      break
  if is_prime: prime.append(i)

print((min([i for i in prime if i >= X])))

# Optimized solution
X = int(eval(input()))

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

for i in range(X, 100004):
  if is_prime(i):
    print(i)
    break
# Original solution
x = int(eval(input()))

s =[2]
a = x

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





# Optimized solution
x = int(eval(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)
# Original solution
from subprocess import*
x=int(eval(input()))
while len(Popen(['factor',str(x)],stdout=PIPE).communicate()[0].split())>2:x+=1
print(x)

# Optimized solution
x=int(eval(input()))
while any(x%i<1for i in range(2,x)):x+=1
print(x)
# Original solution
import math
x = int(eval(input()))
def prime_get():
    if x <= 1:
        return []
    prime = [2]
    limit = int(math.sqrt(x))
    data = [i+1 for i in range(2,100004,2)]

    while limit >= data[0]:
        prime.append(data[0])
        data = [j for j in data if j % data[0] != 0]
    return prime+data

ans = prime_get()
ans = [i for i in ans if i >= x]
print((ans[0]))


# Optimized solution
import math
x = int(eval(input()))

def prime(x):
    if x == 2:
        return True
    elif x % 2 == 0:
        return False
    elif x > 2:
        for i in range(3, math.floor(math.sqrt(x))+1,2):
            if x % i == 0:
                return False
        return True
while prime(x) != True :
    x += 1
print(x)
# Original solution
x = int(eval(input()))

def get_prime(n):
    p = [2]
    for i in range(3, n, 2):
        if all(i%j!=0 for j in p):
            p.append(i)
    return p

p = get_prime(x)

if x == 2:
    print((2))
else:
    if x%2 == 0:
        x += 1
    while True:
        for prime in p:
            if x%prime == 0:
                break
        else:
            print(x)
            break
        x += 2


# Optimized solution
x = int(eval(input()))
if x == 2:
    print((2))
    exit()
elif x%2 == 0:
    x += 1
 
def get_prime(n):
    p = [2]
    for i in range(3, n, 2):
        if all(i%j!=0 for j in p):
            p.append(i)
    return p
 
p = get_prime(x)
 
while True:
    for prime in p:
        if x%prime == 0:
            break
    else:
        print(x)
        break
    x += 2
# Original solution
x = int(eval(input()))
num = 2

# 素数リスト
prime_list = []

while True:
    # 取り出した数字が素数リストの要素で割れなければ素数リストに追加する
    if all(num % prime != 0 for prime in prime_list):
        prime_list.append(num)
        if num >= x:
            break
    num += 1

print(num)

# Optimized solution
x = int(eval(input()))

import random


def is_prime3(q, k=50):
    q = abs(q)
    # 計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q & 1 == 0: return False

    # n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    # 判定をk回繰り返す
    for i in range(k):
        a = random.randint(1, q - 1)
        t = d
        y = pow(a, t, q)
        # [0,s-1]の範囲すべてをチェック
        while t != q - 1 and y != 1 and y != q - 1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q - 1 and t & 1 == 0:
            return False
    return True


while True:
    if is_prime3(x):
        print(x)
        exit()
    x += 1
# Original solution
import math

x = int(eval(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

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

print(i)


# Optimized solution
import math

x = int(eval(input()))

def is_prime(n: int) -> bool:
    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(x):
        break
    x += 1
print(x)
# Original solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    x = int(readline())
    for i in range(x, 10 ** 10):
        b = True
        for j in range(2, int(i ** 0.5) + 1):
            if i % j == 0:
                b = False
                break
        if b:
            print(i)
            exit()


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    x = int(input().rstrip('\n'))
    for i in range(x, 10 ** 10):
        b = True
        for j in range(2, int(i ** 0.5) + 1):
            if i % j == 0:
                b = False
                break
        if b:
            print(i)
            exit()


if __name__ == '__main__':
    solve()
# Original solution
def miller_rabin(n, k=10000):
    import random
    if n == 2:
        return True
    if n == 1 or n & 1 == 0:
        return False
    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1
    for _ in range(k):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)
        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1
        if y != n - 1 and t & 1 == 0:
            return False
    return True
def main():
  x=int(eval(input()))
  for i in range(x,1000000):
    if miller_rabin(i):
      print(i)
      return
main()

# Optimized solution
def miller_rabin(n, k=100):
    import random
    if n == 2:
        return True
    if n == 1 or n & 1 == 0:
        return False
    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1
    for _ in range(k):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)
        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1
        if y != n - 1 and t & 1 == 0:
            return False
    return True
def main():
  x=int(eval(input()))
  for i in range(x,1000000):
    if miller_rabin(i):
      print(i)
      return
main()
# Original solution
x = int(eval(input()))
while True:
    if all(x % i != 0 for i in range(2, x)):
        print(x)
        exit()
    else:
        x+=1

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

x = int(eval(input()))
while True:
    if is_prime(x):
        print(x)
        exit()
    x+=1
# Original solution
x=int(eval(input()))
def primeddx(x):
    for i in range(2,x):
        if x%i==0:
            return False
    return True

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

# Optimized solution
x=int(eval(input()))
def primeddx(x):
    for i in range(2,int(x**0.5)):
        if x%i==0:
            return False
    return True

while not primeddx(x):
    x+=1
print(x)
# Original solution
def isPrime(n):
    # 素数判定
    if n < 2:
        return False
    for i in range(2, n + 1):
        if n < i ** 2:
            break
        if n % i == 0:
            return False
    return True


def main():
    X = int(eval(input()))
    while True:
        if isPrime(X):
            print(X)
            break
        X += 1
    return


main()


# Optimized solution
def isPrime(n):
    # 素数判定
    if n == 2:
        return True
    if n < 2 or n % 2 == 0:
        return False
    m = 3
    while m * m <= n:
        if n % m == 0:
            return False
        m += 2
    return True


def main():
    X = int(eval(input()))
    while True:
        if isPrime(X):
            print(X)
            break
        X += 1
    return


main()
# Original solution
s = int(eval(input()))
if s <= 2:
  print((2))
  exit()
elif s <= 3:
  print((3))
  exit()
elif s <= 5:
  print((5))
  exit()

while True:
  for i in range(2,s // 2):
    if s % i == 0:
      break
  if i == s //2 -1:
    print(s)
    exit()
  s += 1



# Optimized solution
##C
X = int(eval(input()))
##素数かどうか判定
from math import sqrt
def is_prime(n):
    for i in range(2, int(sqrt(n))):
        if n % i == 0:
            return False
    else:
        return True

while (not is_prime(X)):
    X += 1

print(X)
# Original solution
import sys
def input(): return sys.stdin.readline().rstrip()
def prime_list(n):
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5+1)):
        primes-=set(range(i*2, n+1, i))
    return list(primes)
def main():
    x=int(eval(input()))
    primes = prime_list(100010)
    for p in primes:
        if p >= x:
            print(p)
            break
if __name__=='__main__':
    main()

# Optimized solution
import sys
def input(): return sys.stdin.readline().rstrip()
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
def main():
    x=int(eval(input()))
    while True:
        if is_prime(x)==True:
            print(x)
            break
        x+=1
if __name__=='__main__':
    main()
# Original solution
n = int(eval(input()))

s = {2}
#for i in range(3, n, 2):
z = 2
i = 3
while z < n:
    x = 1
    for j in s:
        if i % j == 0:
            x = 0
            break
    if x:
        z = i
        s.add(i)
    i += 2
print(z)

# Optimized solution
n = int(eval(input()))

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

i = n
while True:
    if isprime(i):
        break
    else:
        i += 1
print(i)
# Original solution
X = int(eval(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]]
data = primes(2*X)
for i in range(len(data)):
    if data[i] >= X:
        ans = data[i]
        break
print(ans)

# Optimized solution
X = int(eval(input()))
def is_prime(x):
    flag = True
    for i in range(2,int(x**(0.5))+1):
        if x % i == 0:
            flag = False
    return flag
for i in range(X,2*X+1):
    if is_prime(i):
        print(i)
        break