Buggy python submission (verdict: Time Limit Exceeded):
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

if X == 3:
    print(X)
    sys.exit()

if (X == 4) | (X == 5):
    print(5)
    sys.exit()

if X % 2 == 0:
    X += 1

while True:
    isNotPrime = False
    temp = pow(2,X-1,X)
    if temp == 1:
        if (X % 6 != 1) & (X % 6 != 5):
            X += 2
            continue
        for i in range(3,int(math.sqrt(X))+1,2):
            if X % i == 0:
                isNotPrime = True
            if isNotPrime:
                break
        if isNotPrime == False:
            break
    else:
        X += 2

print(X)


Fixed submission:
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

def segment_sieve(a,b):
    ass = []
    is_prime_small = [True] * (int(b**0.5)+1)
    is_prime = [True] * (b-a)
    for i in range(2,int(b**0.5)):
        if is_prime_small[i]:
            j = 2*i
            while j**2 < b:
                is_prime_small[j] = False
                j += i
            j = max(2*i,((a+i-1)//i)*i)
            while j < b:
                is_prime[j-a] = False
                j += i
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(a+i)
    if ass[0] == 1:
        del ass[0]
    return ass

list = segment_sieve(X,100004)
res = list[0]

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

if X % 2 == 0:
    X += 1

while True:
    isNotPrime = False
    temp = pow(2,X-1,X)
    if temp == 1:
        for i in range(3,int(math.sqrt(X))+1,2):
            if X % i == 0:
                isNotPrime = True
            if isNotPrime:
                break
        if isNotPrime == False:
            break
    else:
        X += 2

print(X)


Fixed submission:
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

def segment_sieve(a,b):
    ass = []
    is_prime_small = [True] * (int(b**0.5)+1)
    is_prime = [True] * (b-a)
    for i in range(2,int(b**0.5)):
        if is_prime_small[i]:
            j = 2*i
            while j**2 < b:
                is_prime_small[j] = False
                j += i
            j = max(2*i,((a+i-1)//i)*i)
            while j < b:
                is_prime[j-a] = False
                j += i
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(a+i)
    if ass[0] == 1:
        del ass[0]
    return ass

list = segment_sieve(X,100004)
res = list[0]

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

if X % 2 == 0:
    X += 1

while True:
    isNotPrime = False
    temp = pow(2,X-1,X)
    if temp == 1:
        for i in range(3,int(math.sqrt(X))+1,2):
            if X % i == 0:
                isNotPrime = True
            if isNotPrime:
                break
        if isNotPrime == False:
            break
    else:
        X += 2

print(X)


Fixed submission:
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

def segment_sieve(a,b):
    ass = []
    is_prime_small = [True] * (int(b**0.5)+1)
    is_prime = [True] * (b-a)
    for i in range(2,int(b**0.5)):
        if is_prime_small[i]:
            j = 2*i
            while j**2 < b:
                is_prime_small[j] = False
                j += i
            j = max(2*i,((a+i-1)//i)*i)
            while j < b:
                is_prime[j-a] = False
                j += i
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(a+i)
    if ass[0] == 1:
        del ass[0]
    return ass

list = segment_sieve(X,100004)
res = list[0]

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

if X % 2 == 0:
    X += 1

while True:
    isNotPrime = False
    temp = pow(2,X-1,X)
    if temp == 1:
        for i in range(2,int(math.sqrt(X)+1)):
            if X % i == 0:
                isNotPrime = True
            if isNotPrime:
                break
        if isNotPrime == False:
            break
    else:
        X += 2

print(X)


Fixed submission:
# import numpy as np
import math
import sys
input = sys.stdin.readline

X = int(input())

if X == 2:
    print(X)
    sys.exit()

def segment_sieve(a,b):
    ass = []
    is_prime_small = [True] * (int(b**0.5)+1)
    is_prime = [True] * (b-a)
    for i in range(2,int(b**0.5)):
        if is_prime_small[i]:
            j = 2*i
            while j**2 < b:
                is_prime_small[j] = False
                j += i
            j = max(2*i,((a+i-1)//i)*i)
            while j < b:
                is_prime[j-a] = False
                j += i
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(a+i)
    if ass[0] == 1:
        del ass[0]
    return ass

list = segment_sieve(X,100004)
res = list[0]

print(res)