Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2])))


Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2]))
Buggy python submission (verdict: Runtime Error):
n = int(input)

for i in range(n):
    t, x, y = map(int, input().split())
    if x+y > t or x+y+t % 2:
        print("NO")
        exit()
print("YES")

Fixed submission:
n = int(input())

for i in range(n):
    t, x, y = map(int, input().split())
    if (x+y) > t or (x+y+t) % 2:
        print("No")
        exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
n = int(input())

d = []
for i in range(n):
    d.append(int(input()))

d_2 = sorted(d, reverse=True)
ans = 1
for i in range(1, n):
    if d_2[i] < d_2[i-1]:
        ans += 1
    else:
        continue

print(ans)

Fixed submission:
print(input().replace("2017", "2018"))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = 0
 
for i in range(n+1):
  	if a <= sum(list(map(int, list(str(i))))) <= b:
      	ans += i
print(ans)

Fixed submission:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
 
result = 0
les = 0
while les == 0:
  for i in range(n):
    les += a[i] % 2
    a[i] = a[i]/2
  result += 1
  
result -= 1
print(result)

Fixed submission:
print(input().count("1"))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(float, input().split()))
 
result = 0
les = 0
while les == 0:
  for i in range(n):
    les += a[i] % 2
    a[i] = a[i]/2
  result += 1
  
result -= 1
print(result)

Fixed submission:
print(input().count("1"))
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(200000)

a, b, c = map(int, input().sprit())
num = 100 *a + 10*b + c
 
if num%4==0:
    print("YES")
else:
    print("NO")

Fixed submission:
a, b, c = map(int, input().split())
num = 100 *a + 10*b + c
 
if num%4==0:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().sprit())
num = 100 *a + 10*b + c

if num%4==0:
    print("YES")
else:
    print("NO")

Fixed submission:
a, b, c = map(int, input().split())
num = 100 *a + 10*b + c
 
if num%4==0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

k = int(input())
cnt = 0
for a in range(k):
    for b in range(k):
        for c in range(k):
            d = gcd(a+1,b+1)
            cnt = cnt + gcd(d,c+1)
print(cnt)


Fixed submission:
n = int(input())
n1 = n//10
n2 = n1//10
if n%10 == 7 or n1%10 == 7 or n2%10 == 7:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

k = int(input())
cnt = 0
for a in range(k):
    for b in range(k):
        for c in range(k):
            d = math.gcd(a+1,b+1)
            cnt = cnt + math.gcd(d,c+1)
print(cnt)



Fixed submission:
import math

k = int(input())
cnt = 0
for a in range(k):
    for b in range(k):
        for c in range(k):
            cnt = cnt + math.gcd(math.gcd(a+1,b+1),c+1)
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
k = int(input())
def gcd(*numbers):
    return reduce(math.gcd, numbers)
cnt = 0
for a in range(k):
    for b in range(k):
        for c in range(k):
            cnt = cnt + gcd(a+1,b+1,c+1)
print(cnt)


Fixed submission:
import math

k = int(input())
cnt = 0
for a in range(k):
    for b in range(k):
        for c in range(k):
            cnt = cnt + math.gcd(math.gcd(a+1,b+1),c+1)
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math
def comb(a, b):
  return math.factorial(a) / (math.factorial(a - b) * math.factorial(b))
print(comb(n + m, 2) - n * m)


Fixed submission:
n, m = map(int, input().split())
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)

Buggy python submission (verdict: Runtime Error):
import math
def comb(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)


Fixed submission:
n, m = map(int, input().split())
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)

Buggy python submission (verdict: Runtime Error):
  import math
  def comb(n, r):
  	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))
  base = comb(n+m, n * 2) + comb(n+m, m * 2)
  print(base)


Fixed submission:
n, m = map(int, input().split())
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)

Buggy python submission (verdict: Runtime Error):
 import math
 def comb(n, r):
 	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 base = comb(n+m, n * 2) + comb(n+m, m * 2)
 print(base)


Fixed submission:
n, m = map(int, input().split())
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)
Buggy python submission (verdict: Runtime Error):
n,m= input().split()
list = list(map(int,input().split()))
sum = 0

for i in list:
    sum += i

if sum>n:
    print("-1")
else:
    print(n-sum)

Fixed submission:
n,m= map(int,input().split())
list = list(map(int,input().split()))
sum = 0

for i in list:
    sum += i

if sum>n:
    print("-1")
else:
    print(n-sum)
Buggy python submission (verdict: Runtime Error):
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 0
for i in range(n):
    if (temp<=int(x)):
        counter +=1
    temp += b_list[i]

print(counter)

Fixed submission:
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 1
for i in range(int(n)):
    temp += b_list[i]
    if (temp<=int(x)):
        counter +=1
    else:
        break

print(counter)

Buggy python submission (verdict: Runtime Error):
n,x= int(input().split())
b_list= list(map(int, input().split()))
temp = 0
counter = 0
for i in b_list:
    if (temp<=x):
        counter +=1
    temp += i

print(counter)


Fixed submission:
n,x= input().split()
b_list= list(map(int, input().split()))
temp = 0
counter = 1
for i in range(int(n)):
    temp += b_list[i]
    if (temp<=int(x)):
        counter +=1
    else:
        break

print(counter)
Buggy python submission (verdict: Runtime Error):
from heapq import heapify, heappush, heappop
X, Y, A, B, C = map(int, input().split())
ps = list(map(int, input().split()))
qs = list(map(int, input().split()))
rs = list(map(int, input().split()))


rs.sort(key=lambda x: -x)
hp = []
hq = []
for p in ps:
    heappush(hp, p)
    if len(hp) > X:
        heappop(hp)

for q in qs:
    heappush(hq, q)
    if len(hq) > Y:
        heappop(hq)

for r in rs:
    if len(hq) < Y:
        heappush(hq, r)
    elif len(hp) < X:
        heappush(hp, r)
    elif hp[0] < hq[0]:
        heappush(hp, r)
        heappop(hp)
    else:
        heappush(hq, r)
        heappop(hq)

print(sum(hq) + sum(hp))


Fixed submission:
ele =  input().strip()
if ele[2] == ele[3] and ele[4] == ele[5]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
total, N = map(int, input().split())
nums = list(map(int, input().split()))
if N == 1:
    print(0)
else:
    ans = total - (total - nums[-1] + nums[0])
    prev = nums[0]
    for num in nums[1:]:
        ans = min(total-(num - prev), ans)
        prev = num
    print(ans)


Fixed submission:
ele =  input().strip()
if ele[2] == ele[3] and ele[4] == ele[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, x, y = map(int, input().split())
ans = [0]*n
x, y = min(x, y), max(x, y)

for i in range(1, n):
    for j in range(i+1, n+1):
        # calculate dist(i, j)
        dist = j - i
        dist = min(dist, abs(j - y) + abs(x - i) + 1)
        dist = min(dist, abs(j - x) + abs(y - i) + 1)
        ans[dist] += 1
print("\n".join(list(map(str, ans[1:]))))


Fixed submission:
n, x, y = map(int, input().split())
ans = [0]*n
x, y = min(x, y), max(x, y)
 
for i in range(1, n):
    for j in range(i+1, n+1):
        # calculate dist(i, j)
        dist = j - i
        dist = min(dist, abs(j - y) + abs(x - i) + 1)
        dist = min(dist, abs(j - x) + abs(y - i) + 1)
        ans[dist] += 1
print("\n".join(list(map(str, ans[1:]))))
Buggy python submission (verdict: Runtime Error):
from collections import deque
MOD = 1000000007

N =  int(input())
childs = [[] for i in range(N+1)]
for i in range(N-1):
    a, b = map(int, input().split())
    childs[a].append(b)
    childs[b].append(a)

dp = [0] * (N + 1) # represent the # if i is the root (1)
tree_size = [0]*(N + 1)
ans = [0] * (N + 1)

n_inv = [1, 1]
n_j_mod = [1, 1]

for i in range(2, N+1):
    n_inv.append((pow(i, MOD-2, MOD) * n_inv[-1]) % MOD)
    n_j_mod.append((n_j_mod[-1] * i) % MOD)


def dfs(i, father=-1):
    method_num = 1
    t_size = 1
    for child in childs[i]:
        if child != father:
            num, size = dfs(child, i)
            method_num = (method_num * num * n_inv[size]) % MOD
            t_size += size
    method_num = (method_num * n_j_mod[t_size - 1]) % MOD
    dp[i] = method_num
    tree_size[i] = t_size
    return method_num, t_size

def rdfs(i, f_num, father=-1):
    ans[i] = (dp[i] * f_num * n_j_mod[N-1] * n_inv[N - tree_size[i]] * n_inv[tree_size[i] - 1]) % MOD

    for child in childs[i]:
        if child != father:
            cf_num = (ans[i] * n_j_mod[tree_size[child]] * n_j_mod[N - tree_size[child] - 1] * n_inv[N - 1] * pow(dp[child], MOD-2, MOD)) % MOD
            rdfs(child, cf_num, i)
dfs(1)

rdfs(1, 1)
print('\n'.join(list(map(str, ans[1:]))))


Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from collections import deque
MOD = 1000000007

N =  int(input())
childs = [[] for i in range(N+1)]
for i in range(N-1):
    a, b = map(int, input().split())
    childs[a].append(b)
    childs[b].append(a)

dp = [0] * (N + 1) # represent the # if i is the root (1)
tree_size = [0]*(N + 1)
ans = [0] * (N + 1)

n_inv = [1, 1]
n_j_mod = [1, 1]

for i in range(2, N+1):
    n_inv.append((pow(i, MOD-2, MOD) * n_inv[-1]) % MOD)
    n_j_mod.append((n_j_mod[-1] * i) % MOD)


def dfs(i, father=-1):
    method_num = 1
    t_size = 1
    for child in childs[i]:
        if child != father:
            num, size = dfs(child, i)
            method_num = (method_num * num * n_inv[size]) % MOD
            t_size += size
    method_num = (method_num * n_j_mod[t_size - 1]) % MOD
    dp[i] = method_num
    tree_size[i] = t_size
    return method_num, t_size

def rdfs(i, f_num, father=-1):
    ans[i] = (dp[i] * f_num * n_j_mod[N-1] * n_inv[N - tree_size[i]] * n_inv[tree_size[i] - 1]) % MOD

    for child in childs[i]:
        if child != father:
            cf_num = (ans[i] * n_j_mod[tree_size[child]] * n_j_mod[N - tree_size[child] - 1] * n_inv[N - 1] * pow(dp[child], MOD-2, MOD)) % MOD
            rdfs(child, cf_num, i)
dfs(1)

rdfs(1, 1)
print('\n'.join(list(map(str, ans[1:]))))
Buggy python submission (verdict: Runtime Error):
def check_block(comb, K):
    block = 0
    pre = (comb & 1) > 0
    mapping = {0: 0}
    cut_num = 0
    for i in range(1, K):
        cur = ((1 << i) & comb) > 0
        if pre != cur:
            block += 1
            pre = cur
            cut_num += 1
        mapping[i] = block
    return mapping, cut_num

H, W, K = map(int, input().split())
graph = [input() for ele in range(H)]
#
ans = 1319203291031903
for comb in range(1<<(H-1)):
    mapping, cut_num = check_block(comb, K)
    pre = [0] * (cut_num + 1)
    gg = False
    # preprocess 
    for j in range(H):
        pre[mapping[j]] += (graph[j][0] == '1')
    for ele in pre:
        if ele > K:
            gg = True
            break
    if gg: continue

    for i in range(1, W):
        cum = pre[:]
        for j in range(H):
            cum[mapping[j]] += (graph[j][i] == '1')
        for ii in range(len(cum)):
            if cum[ii] - pre[ii] > K:
                gg = True
                break
            if cum[ii] > K:
                cut_num += 1
                for idx in range(len(cum)):
                    cum[idx] -= pre[idx]
                break
        pre = cum
        if gg: break

    if not gg:
        ans = min(ans, cut_num)
print(ans)


Fixed submission:
n = int(input())
nums = list(map(int, input().split()))

num_count = {}
for num in nums:
    num_count[num] = num_count.get(num, 0) + 1

total = 0
for num, ele in num_count.items():
    total += (ele * (ele - 1)) // 2

ans = []

for num in nums:
    ans.append(total - num_count[num] + 1)
print("\n".join(list(map(str, ans))))
Buggy python submission (verdict: Time Limit Exceeded):
def check_block(comb, H):
    block = 0
    pre = (comb & 1) > 0
    mapping = {0: 0}
    cut_num = 0
    for i in range(1, H):
        cur = ((1 << i) & comb) > 0
        if pre != cur:
            block += 1
            pre = cur
            cut_num += 1
        mapping[i] = block
    return mapping, cut_num

H, W, K = map(int, input().split())
graph = [input() for ele in range(H)]
#
ans = 1319203291031903
for comb in range(1<<(H-1)):
    mapping, cut_num = check_block(comb, H)
    pre = [0] * (cut_num + 1)
    gg = False
    # preprocess 
    for j in range(H):
        pre[mapping[j]] += (graph[j][0] == '1')
    for ele in pre:
        if ele > K:
            gg = True
            break
    if gg: continue

    for i in range(1, W):
        cum = pre[:]
        for j in range(H):
            cum[mapping[j]] += (graph[j][i] == '1')
        for ii in range(len(cum)):
            if cum[ii] - pre[ii] > K:
                gg = True
                break
            if cum[ii] > K:
                cut_num += 1
                for idx in range(len(cum)):
                    cum[idx] -= pre[idx]
                break
        pre = cum
        if gg: break

    if not gg:
        ans = min(ans, cut_num)
print(ans)


Fixed submission:
def check_block(comb, H):
    block = 0
    pre = (comb & 1) > 0
    mapping = {0: 0}
    cut_num = 0
    for i in range(1, H):
        cur = ((1 << i) & comb) > 0
        if pre != cur:
            block += 1
            pre = cur
            cut_num += 1
        mapping[i] = block
    return mapping, cut_num

H, W, K = map(int, input().split())
graph = [input() for ele in range(H)]
#
ans = 1319203291031903
for comb in range(1<<(H-1)):
    mapping, cut_num = check_block(comb, H)
    pre = [0] * (cut_num + 1)
    gg = False
    # preprocess 
    for j in range(H):
        pre[mapping[j]] += (graph[j][0] == '1')
    for ele in pre:
        if ele > K:
            gg = True
            break
    if gg: continue

    for i in range(1, W):
        cum = pre[:]
        for j in range(H):
            cum[mapping[j]] += (graph[j][i] == '1')
        for ii in range(len(cum)):
            if cum[ii] - pre[ii] > K or cut_num > ans:
                gg = True
                break
            if cum[ii] > K:
                cut_num += 1
                for idx in range(len(cum)):
                    cum[idx] -= pre[idx]
                break
        pre = cum
        if gg: break

    if not gg:
        ans = min(ans, cut_num)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, P = map(int, input().split())
num = input().strip()
dp = [0] * N
ans = 0
last = 0
for i in range(N):
    last = (10 * last + int(num[i])) % P
    if last == 0:
        ans += 1 + dp[last]
        dp[last] += 1
    else:
        ans += dp[last]
        dp[last] += 1
print(ans)


Fixed submission:
N, P = map(int, input().split())
num = input().strip()
ans = 0
if P == 2:
    for idx, nu in enumerate(num):
        if nu in '24680':
            ans += idx + 1
elif P == 5:
    for idx, nu in enumerate(num):
        if nu in '50':
            ans += idx + 1
else:
    nnum = [0] * N
    base = 1
    for i in range(N-1, -1, -1):
        nnum[i] = (int(num[i]) * base) % P
        base = (base * 10) % P
    for i in range(1, N):
        nnum[i] = (nnum[i] + nnum[i-1]) % P
    dp = [0] * P
    for i in range(N):
        if nnum[i] == 0:
            ans += 1 + dp[nnum[i]]
        else:
            ans += dp[nnum[i]]
        dp[nnum[i]] += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
num = input().strip()
dp = [[0] * P for i in range(2)]
cur = True
ans = 0
for ele in num:
    last = ~cur
    cur_num = int(ele)
    for i in range(P):
        dp[cur][i] = 0

    for i in range(P):
        dp[cur][((i * 10) + cur_num) % P] += dp[last][i]
    dp[cur][cur_num % P] += 1
    ans += dp[cur][0]
    cur = ~cur
print(ans)


Fixed submission:
N, P = map(int, input().split())
num = input().strip()
ans = 0
if P == 2:
    for idx, nu in enumerate(num):
        if nu in '24680':
            ans += idx + 1
elif P == 5:
    for idx, nu in enumerate(num):
        if nu in '50':
            ans += idx + 1
else:
    nnum = [0] * N
    base = 1
    for i in range(N-1, -1, -1):
        nnum[i] = (int(num[i]) * base) % P
        base = (base * 10) % P
    for i in range(1, N):
        nnum[i] = (nnum[i] + nnum[i-1]) % P
    dp = [0] * P
    for i in range(N):
        if nnum[i] == 0:
            ans += 1 + dp[nnum[i]]
        else:
            ans += dp[nnum[i]]
        dp[nnum[i]] += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import gcd
n = int(input())
nums = list(map(int, input().split()))

prefix_gcd = []

prefix_gcd.append(nums[0])

for i in nums[1:]:
    prefix_gcd.append(gcd(i,prefix_gcd[-1]))

postfix_gcd = []
postfix_gcd.append(nums[-1])

for j in range(n-2,-1,-1):
    postfix_gcd.append(gcd(nums[j],postfix_gcd[-1]))

postfix_gcd = postfix_gcd[::-1]

ans = 1

for i in range(n):
    # del i
    if i == 0:
        ans = max(ans,postfix_gcd[i+1])
    elif i == n-1:
        ans = max(ans,prefix_gcd[i-1])
    else:
        ans = max(ans, gcd(prefix_gcd[i-1], postfix_gcd[i+1]))
print(ans)


Fixed submission:
def gcd(a, b):
    while b:
        a %= b
        a, b = b, a
    return a


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

prefix_gcd = []

prefix_gcd.append(nums[0])

for i in nums[1:]:
    prefix_gcd.append(gcd(i,prefix_gcd[-1]))

postfix_gcd = []
postfix_gcd.append(nums[-1])

for j in range(n-2,-1,-1):
    postfix_gcd.append(gcd(nums[j],postfix_gcd[-1]))

postfix_gcd = postfix_gcd[::-1]

ans = 1

for i in range(n):
    # del i
    if i == 0:
        ans = max(ans,postfix_gcd[i+1])
    elif i == n-1:
        ans = max(ans,prefix_gcd[i-1])
    else:
        ans = max(ans, gcd(prefix_gcd[i-1], postfix_gcd[i+1]))
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

R = int(input())

print(2 * R *np.pi)

Fixed submission:
import numpy as np

R = int(input())

print(2 * R *np.pi)
Buggy python submission (verdict: Runtime Error):
import sys

N, M = map(int, input().split())

A = []
for l in sys.stdin:
    A.append(int(l))
    
need_day = sum(A)
    
if N < need_day:
    print(-1)
else:
    print(N-need_day)

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

need_day = sum(A)

if N < need_day:
    print(-1)
else:
    print(N-need_day)
Buggy python submission (verdict: Runtime Error):
K = int(input())

def isRunRun(X):
    x = str(X)
    sa = 0
    for i in range(len(x)-1):
        if abs(int(x[i]) - int(x[i+1])) > 1:
            return False
    return True

if K > 23527:
    num = 99999999
    count = 23527
elif K > 10000:
    num = 22111101
    count = 10000
elif K > 5000:
    num = 110111
    count = 1000
else:
    num = 1
    count = 0

while count < K:
    if isRunRun(num):
        count += 1
    num += 1

print(num-1)

Fixed submission:
# 1行、2変数を受け取るとき
X, Y, Z = map(int, input().split())

print("{} {} {}".format(Z, X, Y))

Buggy python submission (verdict: Runtime Error):
K = int(input())

def isRunRun(X):
    x = str(X)
    sa = 0
    for i in range(len(x)-1):
        if abs(int(x[i]) - int(x[i+1])) > 1:
            return False
    return True

if K > 10000:
    num = 22111101
    count = 10000
elif K > 5000:
    num = 110111
    count = 1000
else:
    num = 1
    count = 0

while count < K:
    if isRunRun(num):
        count += 1
    num += 1

print(num-1)

Fixed submission:
# 1行、2変数を受け取るとき
X, Y, Z = map(int, input().split())

print("{} {} {}".format(Z, X, Y))

Buggy python submission (verdict: Runtime Error):
K = int(input())

def isRunRun(X):
    x = str(X)
    sa = 0
    for i in range(len(x)-1):
        if abs(int(x[i]) - int(x[i+1])) > 1:
            return False
    return True


if K < 1000:
    num = 1
    count = 0
elif K < 5000:
    num = 110111
    count = 1000
elif K < 10000:
    num = 22111101
    count = 10000


while count < K:
    if isRunRun(num):
        count += 1
    num += 1

print(num-1)

Fixed submission:
# 1行、2変数を受け取るとき
X, Y, Z = map(int, input().split())

print("{} {} {}".format(Z, X, Y))

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

if len([c for c in A if c >= sum(A) / (4 * M)]) >= M:
    print("Yes")
else:
    print("No")

Fixed submission:
# 1行、2変数を受け取るとき
X, Y, Z = map(int, input().split())

print("{} {} {}".format(Z, X, Y))

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

if len([c for c in A if c > sum(A) / (4 * M)]) > M:
    print("Yes")
else:
    print("No")

Fixed submission:
# 1行、2変数を受け取るとき
X, Y, Z = map(int, input().split())

print("{} {} {}".format(Z, X, Y))
Buggy python submission (verdict: Runtime Error):
import bisect
import copy

X, Y, A, B, C = map(int, input().split())
red = list(map(int, input().split()))
green = list(map(int, input().split()))
clear = list(map(int, input().split()))

red.sort()
green.sort()
clear.sort()

red = red[-X:]
green = green[-Y:]

def ins(a, x):
    insert_index = bisect.bisect_left(a,x)
    a.insert(insert_index,x)
    return a[1:]

while clear[-1] > min(red[0], green[0]):
    red_tmp = ins(copy.copy(red), clear[-1])
    green_tmp = ins(copy.copy(green), clear[-1])
    
    if (sum(red_tmp) + sum(green)) >= (sum(red) + sum(green_tmp)):
        # 赤に追加
        red = red_tmp
    else:
        # 緑に追加
        green = green_tmp
        
    if len(clear) == 1:
        break
    else:
        clear = clear[:-1] #clearを消去

print(sum(red) + sum(green))

Fixed submission:
# 1行、1変数を受け取るとき
s = list(input())

if (s[2] == s[3]) & (s[4] == s[5]):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import bisect

X, Y, A, B, C = map(int, input().split())
red = list(map(int, input().split()))
green = list(map(int, input().split()))
clear = list(map(int, input().split()))

red.sort()
green.sort()
clear.sort()

red = red[-X:]
green = green[-Y:]

def ins(a, x):
    insert_index = bisect.bisect_left(a,x)
    a.insert(insert_index,x)
    return a[1:]

while clear[-1] > min(red[0], green[0]):
    red_tmp = ins(red.copy(), clear[-1])
    green_tmp = ins(green.copy(), clear[-1])
    
    if (sum(red_tmp) + sum(green)) >= (sum(red) + sum(green_tmp)):
        # 赤に追加
        red = red_tmp
    else:
        # 緑に追加
        green = green_tmp
        
    if len(clear) == 1:
        break
    else:
        clear = clear[:-1] #clearを消去

print(sum(red) + sum(green))

Fixed submission:
# 1行、1変数を受け取るとき
s = list(input())

if (s[2] == s[3]) & (s[4] == s[5]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
# 1行、1変数を受け取るとき
s = int(input())

print(int(s / 500) * 1000) + (int(s % 10 / 5) * 5)

Fixed submission:
# 1行、1変数を受け取るとき
s = int(input())
print((int(s / 500) * 1000) + (int(s % 500 / 5) * 5))