Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# input
N, K, Q = map(int, input().split())
points = [K] * N
for q in range(Q):
    A = int(input())

    # check
    points = list(map(lambda x: x - 1, points))
    points[A - 1] += 1

# output
for p in points:
    if p > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
# input
N, K, Q = map(int, input().split())
points = {}
for i in range(1, N + 1):
    points[i] = 0

for q in range(Q):
    A = int(input())

    # check
    points[A] += 1

# output
for k in points.keys():
    if K - Q + points[k] > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
# input
N, K, Q = map(int, input().split())
points = [K] * N
for q in range(Q):
    A = int(input())
    
    # check
    for i, p in enumerate(points):
        if i + 1 == A:
            continue
        points[i] -= 1

for p in points:
    if p > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
# input
N, K, Q = map(int, input().split())
points = {}
for i in range(1, N + 1):
    points[i] = 0

for q in range(Q):
    A = int(input())

    # check
    points[A] += 1

# output
for k in points.keys():
    if K - Q + points[k] > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
from itertools import combinations

# input
N = int(input())
print(len(list(combinations([for i in range(1, N + 1)] * 3, 3))))

Fixed submission:
from itertools import combinations

# input
N = int(input())
print(len(set(combinations([i for i in range(1, N + 1)] * 3, 3))))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(max([a + B, a - b, a * b]))

Fixed submission:
# input
A, B = map(int, input().split())
print(max([A + B, A - B, A * B]))
Buggy python submission (verdict: Time Limit Exceeded):
# input
N = int(input())
A = []
append = A.append

for i in range(N):
    append(int(input()))

# check
for i in range(N):
    nor_result = [n for j, n in enumerate(A) if j != i]
    if not nor_result:
        continue
    print(max(nor_result))

Fixed submission:
# input
N = int(input())
A = []
append = A.append

for i in range(N):
    append(int(input()))

sort_A = sorted(A, reverse=True)[:2]

# check
for a in A:
    if a == sort_A[0]:
        print(sort_A[1])
    else:
        print(sort_A[0])

Buggy python submission (verdict: Runtime Error):
# input
N = int(input())
A = []
append = A.append

for i in range(N):
    append(int(input()))

# check
set_A = list(set(A))
for a in A:
    print(max([sa for sa in set_A if sa != a]))

Fixed submission:
# input
N = int(input())
A = []
append = A.append

for i in range(N):
    append(int(input()))

sort_A = sorted(A, reverse=True)[:2]

# check
for a in A:
    if a == sort_A[0]:
        print(sort_A[1])
    else:
        print(sort_A[0])
Buggy python submission (verdict: Runtime Error):
from itertools import combinations

# input
L, R = map(int, input().split())
mod0 = [n for n in range(0, R + 1, 2019) if L <= n <= R]
# check
target_num = list(range(L, R + 1))
if mod0:
    print(0)
else:
    nC2 = list(combinations(target_num, 2))
    mods_ans = [(i * j) % 2019 for i, j in nC2]

    print(min(mods_ans))

Fixed submission:
from itertools import combinations

# input
L, R = map(int, input().split())

# check
mod0 = [n for n in range(0, R + 1, 2019) if L <= n]
if not mod0:
    target_num = list(range(L, R + 1))
    nC2 = list(combinations(target_num, 2))
    mods_ans = [(i * j) % 2019 for i, j in nC2]

    print(min(mods_ans))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
from itertools import combinations

# input
L, R = map(int, input().split())

# check
target_num = list(range(L, R + 1))
nC2 = list(combinations(target_num, 2))
mods_ans = [(i * j) % 2019 for i, j in nC2]

print(min(mods_ans))

Fixed submission:
from itertools import combinations

# input
L, R = map(int, input().split())

# check
mod0 = [n for n in range(0, R + 1, 2019) if L <= n]
if not mod0:
    target_num = list(range(L, R + 1))
    nC2 = list(combinations(target_num, 2))
    mods_ans = [(i * j) % 2019 for i, j in nC2]

    print(min(mods_ans))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
# input
S = input()

fl = True
for i in range(0, 4):
    if S[i] == S[i + 1]:
        print("Bad")
        fl = False
        break

if fl is True:
    print("Good")

Fixed submission:
# input
S = input()

fl = True
for i in range(0, 3):
    if S[i] == S[i + 1]:
        print("Bad")
        fl = False
        break

if fl is True:
    print("Good")

Buggy python submission (verdict: Runtime Error):
# input
S = input()

fl = True
for i, s in range(0, 4):
    if S[i] == S[i + 1]:
        print("Bad")
        fl = False
        break

if fl is True:
    print("Good")

Fixed submission:
# input
S = input()

fl = True
for i in range(0, 3):
    if S[i] == S[i + 1]:
        print("Bad")
        fl = False
        break

if fl is True:
    print("Good")
Buggy python submission (verdict: Time Limit Exceeded):
# input
N, M = map(int, input().split())
a = []
a_append = a.append

for n in range(M):
    a_append(int(input()))

mod = 1000000007

# check
check = {}
for n in range(N + 1):
    if n in a:
        check[n] = False
    else:
        check[n] = True

dp = {0: 1}
if check[1] is True:
    dp[1] = 1
else:
    dp[1] = 0

for n in range(2, N + 1):
    dp[n] = 0
    if check[n - 1] is True:
        dp[n] += dp[n - 1]
    if check[n - 2] is True:
        dp[n] += dp[n - 2]
    dp[n] %= mod

print(dp[N])


Fixed submission:
# input
N, M = map(int, input().split())
a = []
a_append = a.append

for n in range(M):
    a_append(int(input()))

mod = 1000000007

# check
check = [True] * (N + 1)
for i in a:
    check[i] = False

dp = {0: 1}
if check[1] is True:
    dp[1] = 1
else:
    dp[1] = 0

for n in range(2, N + 1):
    dp[n] = 0
    if check[n - 1] is True:
        dp[n] += dp[n - 1]
    if check[n - 2] is True:
        dp[n] += dp[n - 2]
    dp[n] %= mod

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
# input
N, M = map(int, input().split())
a = []
a_append = a.append

for n in range(M):
    a_append(int(input()))

mod = 1000000007

# check
dp = {0: 1, 1: 1}
for n in range(2, N + 1):
    dp[n] = 0
    if n - 1 not in a:
        dp[n] += dp[n - 1]
    if n - 2 not in a:
        dp[n] += dp[n - 2]

print(dp[N] % mod)

Fixed submission:
# input
N, M = map(int, input().split())
a = []
a_append = a.append

for n in range(M):
    a_append(int(input()))

mod = 1000000007

# check
check = [True] * (N + 1)
for i in a:
    check[i] = False

dp = {0: 1}
if check[1] is True:
    dp[1] = 1
else:
    dp[1] = 0

for n in range(2, N + 1):
    dp[n] = 0
    if check[n - 1] is True:
        dp[n] += dp[n - 1]
    if check[n - 2] is True:
        dp[n] += dp[n - 2]
    dp[n] %= mod

print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
# input
N, M = map(int, input().split())
mastar_keys = set(list(range(1, N + 1)))
check = []
c_append = check.append
for i in range(1, M + 1):
    L, R = map(int, input().split())
    c = set(list(range(L, R + 1)))
    mastar_keys = mastar_keys & c

print(len(mastar_keys))


Fixed submission:
# input & check
N, M = map(int, input().split())
x, y = 0, N
for i in range(1, M + 1):
    L, R = map(int, input().split())
    x = max(x, L)
    y = min(y, R)

print(len(range(x, y + 1)))

Buggy python submission (verdict: Time Limit Exceeded):
# input
N, M = map(int, input().split())
check = []
c_append = check.append
for i in range(1, M + 1):
    L, R = map(int, input().split())
    c = set(list(range(L, R + 1)))
    if c not in check:
        c_append(c)

# check
mastar_keys = set(list(range(1, N + 1)))
for c in sorted(check, key=lambda x: len(x)):
    mastar_keys = mastar_keys & c
    if len(mastar_keys) == 0:
        break

print(len(mastar_keys))

Fixed submission:
# input & check
N, M = map(int, input().split())
x, y = 0, N
for i in range(1, M + 1):
    L, R = map(int, input().split())
    x = max(x, L)
    y = min(y, R)

print(len(range(x, y + 1)))

Buggy python submission (verdict: Time Limit Exceeded):
# input
N, M = map(int, input().split())
check = []
c_append = check.append
for i in range(1, M + 1):
    L, R = map(int, input().split())
    c_append(set(list(range(L, R + 1))))

# check
mastar_keys = set(list(range(1, N + 1)))
for c in sorted(check, key=lambda x: len(x)):
    mastar_keys = mastar_keys & c
    if len(mastar_keys) == 0:
        break

print(len(mastar_keys))

Fixed submission:
# input & check
N, M = map(int, input().split())
x, y = 0, N
for i in range(1, M + 1):
    L, R = map(int, input().split())
    x = max(x, L)
    y = min(y, R)

print(len(range(x, y + 1)))

Buggy python submission (verdict: Runtime Error):
# input
N, M = map(int, input().split())
check = []
c_append = check.append
for i in range(1, M + 1):
    L, R = map(int, input().split())
    c_append(set(list(range(L, R + 1))))

# check
mastar_keys = set(list(range(1, N + 1)))
for k in sorted(check, key=lambda x: len(x)):
    mastar_keys = mastar_keys & check[k]
    if len(mastar_keys) == 0:
        break

print(len(mastar_keys))

Fixed submission:
# input & check
N, M = map(int, input().split())
x, y = 0, N
for i in range(1, M + 1):
    L, R = map(int, input().split())
    x = max(x, L)
    y = min(y, R)

print(len(range(x, y + 1)))

Buggy python submission (verdict: Time Limit Exceeded):
# input
N, M = map(int, input().split())
check = {}
for i in range(1, M + 1):
    L, R = map(int, input().split())
    check[i] = set(list(range(L, R + 1)))

# check
mastar_keys = set(list(range(1, N + 1)))
for k in check.keys():
    mastar_keys = mastar_keys & check[k]

print(len(mastar_keys))

Fixed submission:
# input & check
N, M = map(int, input().split())
x, y = 0, N
for i in range(1, M + 1):
    L, R = map(int, input().split())
    x = max(x, L)
    y = min(y, R)

print(len(range(x, y + 1)))
Buggy python submission (verdict: Runtime Error):
from math import gcd

# input
N = int(input())
A = list(map(int, input().split()))

# check
A.sort(reverse=True)
max_gcd = A[0]
change = False
for a in A:
    ans = gcd(max_gcd, a)
    if ans < max_gcd and change is False:
        change = True
        continue
    max_gcd = ans

print(max_gcd)


Fixed submission:
from fractions import gcd


n = int(input())
a = list(map(int, input().split()))

# 累積GCD
left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    left[i + 1] = (gcd(left[i], a[i]))
    right[n - i - 1] = (gcd(right[n - i], a[n - 1 - i]))

ans = 0
for i in range(n):
    ans = max(ans, gcd(left[i], right[i + 1]))
print(ans)

Buggy python submission (verdict: Runtime Error):
from math import gcd

# input
N = int(input())
A = list(map(int, input().split()))

# check
A.sort(reverse=True)
max_gcd = A[0]
change = False
for a in A:
    ans = gcd(ans, a)
    if ans < max_gcd and change is False:
        continue
    max_gcd = ans

print(max_gcd)

Fixed submission:
from fractions import gcd


n = int(input())
a = list(map(int, input().split()))

# 累積GCD
left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    left[i + 1] = (gcd(left[i], a[i]))
    right[n - i - 1] = (gcd(right[n - i], a[n - 1 - i]))

ans = 0
for i in range(n):
    ans = max(ans, gcd(left[i], right[i + 1]))
print(ans)
Buggy python submission (verdict: Runtime Error):
# check
length = len(S)
if len == 1:
    print(0)
else:
    bwb = ["0", "1"]
    wbw = ["1", "0"]
    cnt = [0] * 2
    for i in range(length):
        if S[i] == bwb[i % 2]:
            cnt[0] += 1
        if S[i] == wbw[i % 2]:
            cnt[1] += 1
    
    print(min([cnt]))

Fixed submission:
# input
S = list(input())

# check
length = len(S)
if len == 1:
    print(0)
else:
    bwb = ["0", "1"]
    wbw = ["1", "0"]
    cnt = [0] * 2
    for i in range(length):
        if S[i] == bwb[i % 2]:
            cnt[0] += 1
        if S[i] == wbw[i % 2]:
            cnt[1] += 1

    print(min(cnt))
Buggy python submission (verdict: Time Limit Exceeded):
# input
N = int(input())

Cap = []
append = Cap.append
for i in range(5):
    append(int(input()))

# check
total = 0
citys = [N] + ([0] * 5)

while citys[5] != N:
    for i in range(5, 0, -1):

        if 0 < citys[i - 1] <= Cap[i - 1]:
            mov = citys[i - 1]
            citys[i] += mov
            citys[i - 1] = 0
        elif citys[i - 1] > Cap[i - 1]:
            mov = Cap[i - 1]
            citys[i] += mov
            citys[i - 1] -= mov
        else:
            pass
    total += 1

print(total)

Fixed submission:
# input
N = int(input())

Cap = []
append = Cap.append
for i in range(5):
    append(int(input()))

# check
total = 0
citys = [N] + ([0] * 5)

bottleneck = min(Cap)
print((N + bottleneck - 1) // bottleneck + 4)
Buggy python submission (verdict: Runtime Error):
# input
A, B, K = map(int, input().split())

# check
if K == 1:
    print(1)
else:
    cnt, op = 1, 1
    div_nums = []
    append = div_nums.append
    for i in range(2, min(A, B) + 1):
        if A % i == 0 and B % i == 0:
            append(i)
    
    print(div_nums[-K])

Fixed submission:
# input
A, B, K = map(int, input().split())

# check
div_nums = [1]
append = div_nums.append
for i in range(2, min(A, B) + 1):
    if A % i == 0 and B % i == 0:
        append(i)

print(div_nums[-K])
Buggy python submission (verdict: Time Limit Exceeded):
# input
S = input()
N = len(S)

# check
cnt = 0
del_ind = []
append = del_ind.append

while N > 1:
    for i in range(1, N):
        if S[i - 1:i + 1] in ["01", "10"]:
            cnt += 2
            N -= 2
            S = S[:i - 1] + S[i + 1:]
            break
print(cnt)

Fixed submission:
# input
S = input()
N = len(S)

# check
print(min(S.count("0"), S.count("1")) * 2)
Buggy python submission (verdict: Runtime Error):
# input
T, X = int(input())

print(T / X)

Fixed submission:
# input
T, X = map(int, input().split()) 

print(T / X)
Buggy python submission (verdict: Runtime Error):
# input
N = int(input())
L = list(map(int, input().split()))

if max(L) < sum(L) - max(L):
    print("Yes")
else;
    print("No")

Fixed submission:
# input
N = int(input())
L = list(map(int, input().split()))

if max(L) < sum(L) - max(L):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
# input
N, M = map(int, input().split()) 
X = list(map(int, input().split()))

X.sort()
K = [
    abs(X[i] - X[i - 1])
    for i in range(1, N)
]

print(sum(K[:M - (N - 1)])

Fixed submission:
# input
N, M = map(int, input().split())
X = list(map(int, input().split()))

X.sort()
K = sorted(
    [
        abs(X[i] - X[i - 1])
        for i in range(1, M)
    ],
    reverse=True
)

print(sum(K[N - 1:]))

Buggy python submission (verdict: Runtime Error):
# input
N, M = int(input())
X = list(map(int, input().split()))

X.sort()
K = [
    abs(X[i] - X[i - 1])
    for i in range(1, N)
]

print(sum(K[:M - (N - 1)]))

Fixed submission:
# input
N, M = map(int, input().split())
X = list(map(int, input().split()))

X.sort()
K = sorted(
    [
        abs(X[i] - X[i - 1])
        for i in range(1, M)
    ],
    reverse=True
)

print(sum(K[N - 1:]))

Buggy python submission (verdict: Runtime Error):
# input
N, M = int(input())
X = list(map(int, input().split()))

X.sort()
K = [
    abs(X[i] - X[i - 1])
    for i in range(1, N)
]

print(sum(K[:M - (N - 1)]))

Fixed submission:
# input
N, M = map(int, input().split())
X = list(map(int, input().split()))

X.sort()
K = sorted(
    [
        abs(X[i] - X[i - 1])
        for i in range(1, M)
    ],
    reverse=True
)

print(sum(K[N - 1:]))

Buggy python submission (verdict: Runtime Error):
# input
N, M = int(input())
X = list(map(int, input().split()))

X.sort()
K = [
    abs(X[n] - X[n - 1])
    for i in range(1, N)
]

print(sum(K[:M - (N - 1)]))


Fixed submission:
# input
N, M = map(int, input().split())
X = list(map(int, input().split()))

X.sort()
K = sorted(
    [
        abs(X[i] - X[i - 1])
        for i in range(1, M)
    ],
    reverse=True
)

print(sum(K[N - 1:]))
Buggy python submission (verdict: Time Limit Exceeded):
# input
s = int(input())

# check
fn = {1: s}
lim = 1000001
fs = None
for m in range(2, lim):
    if m % 2 == 0:
        fn[m] = fn[m - 1] // 2
    else:
        fn[m] = 3 * fn[m - 1] + 1

    print(m, fn[m])

    if not fs and m == s: 
        fs = fn[m]
    
    if fs in [fn[k] for k in fn.keys() if k != s]:
        print(m)
        break

Fixed submission:
# input
s = int(input())

# check
lim = 1000001
# 初項が 4 or 2 or 1 なら
# 4, 2, 1, 4, 2, 1, …
# となるので、答えは4になる
if s == 1 or s == 2:
  print(4)
else:

    c4 = 0
    c = 1
    for m in range(2, lim):
        # 4の出現回数をカウントする
        if s == 4:
            c4 += 1

        # 2回4が出てきたら終了
        if c4 == 2:
            print(c)
            exit()

        # 指示された操作
        if s % 2 == 0:
            s //= 2
        else:
            s = 3 * s + 1

        # 項番をインクリメント
        c += 1
Buggy python submission (verdict: Runtime Error):
# input
N = int(input())

# check
if N < 357:
    print(0)
else:
    max_dig = len(str(N))
    dig = 3
    sgs_nuns = []
    sgs = set(["7", "5", "3"])
    str_join = "".join
    for n in range(3, max_dig + 1):
        sgs_nuns += [
            str_join(n)
            for n in product(["7", "5", "3"], repeat=n)
            if set(str_join(n)) == sgs and int(str_join(n)) <= N
        ]

    cnt = len(sgs_nuns)
    print(cnt)

Fixed submission:
from itertools import product

# input
N = int(input())

# check
if N < 357:
    print(0)
else:
    max_dig = len(str(N))
    dig = 3
    sgs_nuns = []
    sgs = {"7", "5", "3"}
    str_join = "".join
    for n in range(3, max_dig + 1):
        sgs_nuns += [
            str_join(n)
            for n in product(["7", "5", "3"], repeat=n)
            if set(str_join(n)) == sgs and int(str_join(n)) <= N
        ]

    cnt = len(sgs_nuns)
    print(cnt)

Buggy python submission (verdict: Runtime Error):
# check
if N < 357:
    print(0)
else:
    cnt = 1
    for n in range(358, N + 1):
        if set(str(n)) == set(['7', '5', '3']):
            cnt += 1
    print(cnt)

Fixed submission:
from itertools import product

# input
N = int(input())

# check
if N < 357:
    print(0)
else:
    max_dig = len(str(N))
    dig = 3
    sgs_nuns = []
    sgs = {"7", "5", "3"}
    str_join = "".join
    for n in range(3, max_dig + 1):
        sgs_nuns += [
            str_join(n)
            for n in product(["7", "5", "3"], repeat=n)
            if set(str_join(n)) == sgs and int(str_join(n)) <= N
        ]

    cnt = len(sgs_nuns)
    print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
# input
N, M = map(int, input().split())

citys = []
c_append = citys.append
prefs = []
p_append = prefs.append
for i in range(M):
    P, Y = map(int, input().split())
    if P not in prefs:
        p_append(P)

    c_append(
        {
            "birth": Y,
            "pref": P,
            "number": "0" * (6 - len(str(P))) + str(P)
        }
    )

# check
for p in prefs:
    target_citys = [
        c
        for c in citys
        if c["pref"] == p
    ]
    target_citys.sort(key=lambda x: x["birth"])
    lot_num = 1
    for c in target_citys:
        c["number"] += "0" * (6 - len(str(lot_num))) + str(lot_num)
        lot_num += 1

for c in citys:
    print(c["number"])

Fixed submission:
N, M = map(int, input().split())
piys = [[] for _ in range(N)]
for i in range(M):
    p, y = map(int, input().split())
    piys[p-1].append((y, i))

ans = [None]*M
for p, iys in enumerate(piys):
    iys.sort()
    for k, (y, i) in enumerate(iys):
        ans[i] = "%06d%06d" % (p+1, k+1)

for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

# input
N, X = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
k = [
    abs(X - p)
    if i == 0
    else
    abs(p - x[i - 1])
    for i, p in enumerate(x)
]
D = gcd(k[0], k[1])
for n in range(2, N):
    D = gcd(D, k[n])

print(D)

Fixed submission:
from fractions import gcd

# input
N, X = map(int, input().split())
x = list(map(int, input().split()))
x.sort()

if len(x) == 1:
    print(abs(X - x[0]))
else:
    k = [
        abs(X - p)
        if i == 0
        else
        abs(p - x[i - 1])
        for i, p in enumerate(x)
    ]
    D = gcd(k[0], k[1])
    for n in range(2, N):
        D = gcd(D, k[n])
    
    print(D)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

# input
s = input()
K = int(input())

# check
case = []
append = case.append
for i in range(1, K + 1):
    for c in combinations(list(s), i):
        if "".join(c) in s and "".join(c) not in case:
            append("".join(c))
case.sort(reverse=True)

print(case[-K])

Fixed submission:
# input
s = input()
K = int(input())

# check
case = []
append = case.append
for i in range(1, K + 1):
    for idx in range(0, len(s) - (i - 1)):
        if s[idx:idx + i] not in case:
            append(s[idx:idx + i])
case.sort(reverse=True)

print(case[-K])

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

# input
s = input()
K = int(input())

# check
case = []
append = case.append
for i in range(1, len(s) + 1):
    for c in combinations(list(s), i):
        if "".join(c) in s and "".join(c) not in case:
            append("".join(c))
case.sort(reverse=True)

print(case[-K])

Fixed submission:
# input
s = input()
K = int(input())

# check
case = []
append = case.append
for i in range(1, K + 1):
    for idx in range(0, len(s) - (i - 1)):
        if s[idx:idx + i] not in case:
            append(s[idx:idx + i])
case.sort(reverse=True)

print(case[-K])
Buggy python submission (verdict: Runtime Error):
if a <= b:
    print(a)
else:
    print(a - 1)

Fixed submission:
# input
a, b = map(int, input().split())

# check
if a <= b:
    print(a)
else:
    print(a - 1)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations


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


# input
N = int(input())

# check
prime_nums = [n for n in range(2, 55555) if is_prime(n)]
for case in combinations(prime_nums, N):
    fl = True
    for check_case in combinations(case, 5):
        if is_prime(sum(check_case)):
            fl = False
            break
    if fl:
        res = " ".join([str(num) for num in case])
        print(res)
        exit(0)


Fixed submission:
def is_prime(n):
    if n < 2:
        return False
    else:
        for p in range(2, n):
            if n % p == 0:
                return False
        else:
            return True


# input
N = int(input())

# check
prime_nums = []
append = prime_nums.append
for n in range(2, 55555):
    if is_prime(n) and n % 5 == 1:
        append(n)
        if len(prime_nums) == N:
            break

res = " ".join([str(num) for num in prime_nums])
print(res)
exit(0)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

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


# input
N = int(input())

prime_nums = []
append = prime_nums.append
for n in range(2, 55555):
    if is_prime(n) is False:
        continue

    if len(prime_nums) == N:
        break

    if len(prime_nums) >= 5 and not [1 for c in combinations(prime_nums + [n], 5) if is_prime(sum(c))]:
        append(n)

    if len(prime_nums) < 5:
        append(n)

res = " ".join([str(num) for num in prime_nums])

print(res)

Fixed submission:
def is_prime(n):
    if n < 2:
        return False
    else:
        for p in range(2, n):
            if n % p == 0:
                return False
        else:
            return True


# input
N = int(input())

# check
prime_nums = []
append = prime_nums.append
for n in range(2, 55555):
    if is_prime(n) and n % 5 == 1:
        append(n)
        if len(prime_nums) == N:
            break

res = " ".join([str(num) for num in prime_nums])
print(res)
exit(0)