Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import collections as c
import sys
s = input()
l = len(s)

if l == 1:
	print("YES")
else:
	S = c.Counter(list(map(str,s)))
	if len(S.key()) == 1:
		print("NO")
		sys.exit()
	elif len(S.keys()) == 2:
		if l == 2:
			print("YES")
		else:
			print("NO")
		sys.exit()

	cnt = set(list(S.values()))

	if len(cnt) == 3:
		print("NO")
	elif len(cnt) == 2:
		a,b = cnt
		if abs(a-b) <= 1:
			print("YES")
		else:
			print("NO")
	else:
		print("YES")

Fixed submission:
import collections as c
import sys
s = input()
l = len(s)

if l == 1:
	print("YES")
else:
	S = c.Counter(list(map(str,s)))
	if len(S.keys()) == 1:
		print("NO")
		sys.exit()
	elif len(S.keys()) == 2:
		if l == 2:
			print("YES")
		else:
			print("NO")
		sys.exit()

	cnt = set(list(S.values()))

	if len(cnt) == 3:
		print("NO")
	elif len(cnt) == 2:
		a,b = cnt
		if abs(a-b) <= 1:
			print("YES")
		else:
			print("NO")
	else:
		print("YES")

Buggy python submission (verdict: Runtime Error):
import collections as c
import sys
s = input()
l = len(s)

if l == 1:
	print("NO")
else:
	S = c.Counter(list(map(str,s)))

	if len(S.keys()) <= 2:
		if l == 2:
			print("YES")
		else:
			print("NO")
		sys.eixt()

	cnt = set(list(S.values()))

	if len(cnt) == 3:
		print("NO")
	elif len(cnt) == 2:
		a,b = cnt
		if abs(a-b) <= 1:
			print("YES")
		else:
			print("NO")
	else:
		print("YES")

Fixed submission:
import collections as c
import sys
s = input()
l = len(s)

if l == 1:
	print("YES")
else:
	S = c.Counter(list(map(str,s)))
	if len(S.keys()) == 1:
		print("NO")
		sys.exit()
	elif len(S.keys()) == 2:
		if l == 2:
			print("YES")
		else:
			print("NO")
		sys.exit()

	cnt = set(list(S.values()))

	if len(cnt) == 3:
		print("NO")
	elif len(cnt) == 2:
		a,b = cnt
		if abs(a-b) <= 1:
			print("YES")
		else:
			print("NO")
	else:
		print("YES")
Buggy python submission (verdict: Runtime Error):
n = int(input())
l2 = 2
l1 = 1
for i in range(2,n+1):
    l = l2+l1
    l2=l1
    l1=l
print(l)

Fixed submission:
n = int(input())
l2 = 2
l1 = 1
if n == 1:
    print(1)
    exit()
    
for i in range(2,n+1):
    l = l2+l1
    l2=l1
    l1=l
print(l)
Buggy python submission (verdict: Runtime Error):
k = {"A":1,"B":2,"C":3,"D":4,"E":5,"F":6}
x, y = input().split()
xx = '"'+x+'"'
yy = '"'+y+'"'

if k[xx] > k[yy]:
    print(">")
elif k[xx] < k[yy]:
    print("<")
else:
    print("=")

Fixed submission:
x, y = input().split()
if x > y:
    print(">")
elif x < y:
    print("<")
else:
    print("=")
Buggy python submission (verdict: Runtime Error):
SS = input()
T = input()

L_S = len(SS)
L_T = len(T)

COND = 0
for i in range(L_S-L_T+1):
	cond = 1
	t = ('?' * i) + T + ('?' * (L_S-L_T-i))

	ans = ''
	for j in range(L_S):
		if SS[j] == '?' and t[j] == '?':
			ans += 'a'
			
		elif SS[j] == '?' and t[j] != '?':
			ans += t[j]
		elif SS[j] != '?' and t[j] == '?':
			ans += SS[j]
		else:
			if SS[j] != t[j]:
				cond = 0
				ans = ''
				break
			else:
				ans += t[j]

	if cond == 0:
		continue
	else:
		break

if ans == '':
	print('UNRESTORABLE')
else:
	print(ans)

Fixed submission:
SS = input()
T = input()
ans = "z"*(len(SS)+1)

for i in range(len(SS) - len(T) + 1):
	temp = "?"*i + T + "?"*(len(SS)-i-len(T))
	cond = True
	for i in range(len(SS)):
		if SS[i] == "?" or temp[i] == "?":
			continue
		else:
			if SS[i] != temp[i]:
				cond = False
	if cond:
		temp_2 = []
		for i in range(len(SS)):
			if SS[i] == "?" and temp[i] == "?":
				temp_2.append("a")
			elif SS[i] == "?" and temp[i] != "?":
				temp_2.append(temp[i])
			else:
				temp_2.append(SS[i])
		temp_3 = "".join(temp_2)
		if temp_3 <= ans:
			ans = temp_3

if ans == "z"*(len(SS)+1):
	print("UNRESTORABLE")
else:
	print(ans)

Buggy python submission (verdict: Runtime Error):
SS = input()
T = input()

L_S = len(SS)
L_T = len(T)

COND = 0
for i in range(L_S-L_T+1):
	cond = 1
	t = ('?' * i) + T + ('?' * (L_S-L_T-i))

	ans = ''
	for j in range(L_S):
		if SS[j] == '?' and t[j] == '?':
			ans += 'a'
			
		elif SS[j] == '?' and t[j] != '?':
			ans += t[j]
		elif SS[j] != '?' and t[j] == '?':
			ans += SS[j]
		else:
			if SS[j] != t[j]:
				cond = 0
				ans = ''
				break

	if cond == 0:
		continue
	else:
		break

if ans == '':
	print('UNRESTORABLE')
else:
	print(ans)

Fixed submission:
SS = input()
T = input()
ans = "z"*(len(SS)+1)

for i in range(len(SS) - len(T) + 1):
	temp = "?"*i + T + "?"*(len(SS)-i-len(T))
	cond = True
	for i in range(len(SS)):
		if SS[i] == "?" or temp[i] == "?":
			continue
		else:
			if SS[i] != temp[i]:
				cond = False
	if cond:
		temp_2 = []
		for i in range(len(SS)):
			if SS[i] == "?" and temp[i] == "?":
				temp_2.append("a")
			elif SS[i] == "?" and temp[i] != "?":
				temp_2.append(temp[i])
			else:
				temp_2.append(SS[i])
		temp_3 = "".join(temp_2)
		if temp_3 <= ans:
			ans = temp_3

if ans == "z"*(len(SS)+1):
	print("UNRESTORABLE")
else:
	print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

s = input()
s_x = s.replace('x', '')

if len(s) == 1:
	print(0)
	sys.exit()

middle, mod = divmod(len(s_x),2)
middle += mod
if s_x[:middle] != s_x[::-1][:middle]:
	print(-1)
	sys.exit()

pali_orig = s_x[:middle]

x_count_l, x_count_r = [0]*middle, [0]*middle

i = 0
for c in range(middle):
	cnt = 0
	while s[i] != pali_orig[c]:
		cnt += 1
		i += 1
	x_count_l[c] = cnt
	i += 1

i = 0
for c in range(middle):
	cnt = 0
	while s[::-1][i] != pali_orig[c]:
		cnt += 1
		i += 1
	x_count_r[c] = cnt
	i += 1


ans = 0

for i in range(middle):
	ans += abs(x_count_l[i] - x_count_r[i])

print(ans)

Fixed submission:
import sys

s = input()
s_x = s.replace('x', '')

if len(s) == 1:
	print(0)
	sys.exit()

middle, mod = divmod(len(s_x),2)
middle += mod
if s_x[:middle] != s_x[::-1][:middle]:
	print(-1)
	sys.exit()

x_count = []
cnt = 0
for i in range(len(s)):
	if s[i] != 'x':
		x_count.append(cnt)
		cnt = 0
	else:
		cnt += 1
x_count.append(cnt)

ans = 0
for i in range(len(x_count)):
	ans += abs(x_count[i] - x_count[-(1+i)])

print(ans//2)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

s = input()
s_x = s.replace('x', '')

if len(s) == 1:
	print(0)
	sys.exit()

middle, mod = divmod(len(s_x),2)
middle += mod
if s_x[:middle] != s_x[::-1][:middle]:
	print(-1)
	sys.exit()

pali_orig = s_x[:middle]

x_count_l, x_count_r = [0]*middle, [0]*middle

i = 0
for c in range(middle):
	cnt = 0
	while s[i] != pali_orig[c]:
		cnt += 1
		i += 1
	x_count_l[c] = cnt
	i += 1

i = 0
for c in range(middle):
	cnt = 0
	while s[::-1][i] != pali_orig[c]:
		cnt += 1
		i += 1
	x_count_r[c] = cnt
	i += 1


ans = 0

for i in range(middle):
	ans += abs(x_count_l[i] - x_count_r[i])

print(ans)

Fixed submission:
import sys

s = input()
s_x = s.replace('x', '')

if len(s) == 1:
	print(0)
	sys.exit()

middle, mod = divmod(len(s_x),2)
middle += mod
if s_x[:middle] != s_x[::-1][:middle]:
	print(-1)
	sys.exit()

x_count = []
cnt = 0
for i in range(len(s)):
	if s[i] != 'x':
		x_count.append(cnt)
		cnt = 0
	else:
		cnt += 1
x_count.append(cnt)

ans = 0
for i in range(len(x_count)):
	ans += abs(x_count[i] - x_count[-(1+i)])

print(ans//2)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()

if a==b:
    print(c)
    break
elif a==c:
    print(b)
    break
else:
    print(a)

Fixed submission:
a,b,c=input().split()

if a==b:
    print(c)
elif a==c:
    print(b)
else:
    print(a)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        tmp = 4*h*n-N*(n+h)
        if tmp == 0:
            continue
        d,m = divmod(N*h*n, tmp)
        if m == 0 and d > 0:
            print(h,n,d)
            sys.exit()

Fixed submission:
import sys
N = int(input())
for h in range(1,3501):
    for n in range(1,3501):
        tmp = 4*h*n-N*(n+h)
        if tmp == 0:
            continue
        d,m = divmod(N*h*n, tmp)
        if m == 0 and d > 0:
            print(h,n,d)
            sys.exit()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

N = int(input())
E = [list(map(int, input().split())) for _ in range(N)]

inf = float('inf')
for i in range(N):
	E[i][i] = inf

for k in range(N):
	for i in range(N):
		if i == k:
			continue
		for j in range(N):
			if k == j or i == j:
				continue
			direct = E[i][j]
			detour = E[i][k]+E[k][j]
			if direct == inf or detour == inf:
				continue

			if direct > detour:
				print(-1)
				sys.exit()

			elif direct == detour:		
				E[i][j] = inf
				E[j][i] = inf

answer = 0
for i in range(N):
	for j in range(N):
		if E[i][j] == inf:
			continue
		
		answer += E[i][j]

print(answer//2)

Fixed submission:
import sys

N = int(input())
E = [list(map(int, input().split())) for _ in range(N)]

inf = float('inf')
for i in range(N):
	E[i][i] = inf

for k in range(N):
	for i in range(N):
		if i == k:
			continue
		for j in range(N):
			if k == j or i == j:
				continue
			direct = E[i][j]
			detour = E[i][k]+E[k][j]
			if direct == inf or detour == inf:
				continue

			if direct > detour:
				print(-1)
				sys.exit()

			elif direct == detour:		
				E[i][j] = inf
				E[j][i] = inf

answer = 0
for i in range(N):
	for j in range(N):
		if E[i][j] == inf:
			continue
		
		answer += E[i][j]

print(answer//2)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

N = int(input())
E = [list(map(int, input().split())) for _ in range(N)]

ans = [[E[i][j] for j in range(N)] for i in range(N)]

for k in range(N):
	for i in range(N):
		for j in range(N):
			direct = E[i][j]
			detour = E[i][k]+E[k][j]
			if direct < detour:
				continue
			elif direct > detour:
				print(-1)
				sys.exit()

			else:
				if i != k and j != k:
					ans[i][j] = 0
					ans[j][i] = 0

answer = 0
for a in ans:
	answer += sum(a)

print(answer//2)

Fixed submission:
import sys

N = int(input())
E = [list(map(int, input().split())) for _ in range(N)]

inf = float('inf')
for i in range(N):
	E[i][i] = inf

for k in range(N):
	for i in range(N):
		if i == k:
			continue
		for j in range(N):
			if k == j or i == j:
				continue
			direct = E[i][j]
			detour = E[i][k]+E[k][j]
			if direct == inf or detour == inf:
				continue

			if direct > detour:
				print(-1)
				sys.exit()

			elif direct == detour:		
				E[i][j] = inf
				E[j][i] = inf

answer = 0
for i in range(N):
	for j in range(N):
		if E[i][j] == inf:
			continue
		
		answer += E[i][j]

print(answer//2)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = list(map(int,input().split()))
if c<=a<=d<=b:
    print(d-a)
elif c<=a<=b<=d:
    print(b-a)
elif a<=c<=d<=b:
    pirnt(d-c)
elif a<=c<=b<=d:
    print(b-c)
else:
    print(0)

Fixed submission:
a,b,c,d = list(map(int,input().split()))
if c<=a<=d<=b:
    print(d-a)
elif c<=a<=b<=d:
    print(b-a)
elif a<=c<=d<=b:
    print(d-c)
elif a<=c<=b<=d:
    print(b-c)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = list(map(int,input().split()))
if c<a<d<b:
    print(d-a)
elif c<a<b<d:
    print(b-a)
elif a<c<d<b:
    pirnt(d-c)
elif a<c<b<d:
    print(b-c)
else:
    print(0)

Fixed submission:
a,b,c,d = list(map(int,input().split()))
if c<=a<=d<=b:
    print(d-a)
elif c<=a<=b<=d:
    print(b-a)
elif a<=c<=d<=b:
    print(d-c)
elif a<=c<=b<=d:
    print(b-c)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = list(map(int,input().split()))
if c<=a<=d<=b:
    print(d-a)
elif c<=a<=b<=d:
    print(b-a)
elif a<=c<=d<=b:
    pirnt(d-c)
elif a<=c<=b<=d:
    print(b-c)
else:
    print(0)

Fixed submission:
a,b,c,d = list(map(int,input().split()))
if c<=a<=d<=b:
    print(d-a)
elif c<=a<=b<=d:
    print(b-a)
elif a<=c<=d<=b:
    print(d-c)
elif a<=c<=b<=d:
    print(b-c)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import sys
import math
if N == 1:
	print(T[0])
	sys.exit()
def GCD(a,b):
	if b == 0:
		return a
	return GCD(b,a%b)

N = int(input())
T = [int(input()) for _ in range(N)]

def SKS(a,b):
	return (a*b)//GCD(a,b)

for i in range(1,N):
	if i == 1:
		temp = SKS(T[0], T[1])
		continue

	temp = SKS(temp, T[i])

print(temp)

Fixed submission:
N = int(input())
T = [int(input()) for _ in range(N)]

def Eucrid(a,b):
	if b == 0:
		return a
	return Eucrid(b,a%b)


ans = 1
for i in range(N):
	ans = (ans * T[i]) // Eucrid(ans, T[i])

print(ans)

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

def GCD(a,b):
	if b == 0:
		return a
	return GCD(b,a%b)

N = int(input())
T = [int(input()) for _ in range(N)]

def SKS(a,b):
	return (a*b)//GCD(a,b)

for i in range(1,N):
	if i == 1:
		temp = SKS(T[0], T[1])
		continue

	temp = SKS(temp, T[i])

print(temp)

Fixed submission:
N = int(input())
T = [int(input()) for _ in range(N)]

def Eucrid(a,b):
	if b == 0:
		return a
	return Eucrid(b,a%b)


ans = 1
for i in range(N):
	ans = (ans * T[i]) // Eucrid(ans, T[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
H, W = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))
s = ''
for i in range(N):
    s += str(i+1) * A[i]
B = np.array(list(map(int, s)), np.int64).reshape([H,W])

for i in range(H):
    if i % 2 == 0:
        print(*B[i])
    else:
        print(*B[i][::-1])
        

Fixed submission:
import numpy as np
H, W = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))
B = np.zeros([H,W], np.int64)
ind = 0
for i in range(H):
    for j in range(W):
        if A[ind] == 0:
            ind += 1
        B[i,j] = ind+1
        A[ind] -= 1

for i in range(H):
    if i % 2 == 0:
        print(*B[i])
    else:
        print(*B[i][::-1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

s = []
e = []

for _ in range(M):
	tmp = list(map(int, input().split()))
	if 1 in tmp:
		s.append(max(tmp))
	elif N in tmp:
		e.append(min(tmp))

for ss in s:
	if ss in e:
		print("POSSIBLE")
		sys.exit()
print("IMPOSSIBLE")

Fixed submission:
import sys

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

A = [list(map(int, input().split())) for _ in range(M)]
B = []

for i in range(M):
	if 1 in A[i]:
		B.append(A[i][1])
	elif N in A[i]:
		B.append(A[i][0])

C = set(B)

if len(C) == len(B):
	print("IMPOSSIBLE")
else:
	print("POSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

s = []
e = []

for _ in range(M):
	tmp = list(map(int, input().split()))
	if 1 in tmp:
		s.append(max(tmp))
	elif N in tmp:
		e.append(min(tmp))

for ss in s:
	if ss in e:
		print("POSSIBLE")
		sys.exit()
print("IMPOSSIBLE")

Fixed submission:
import sys

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

A = [list(map(int, input().split())) for _ in range(M)]
B = []

for i in range(M):
	if 1 in A[i]:
		B.append(A[i][1])
	elif N in A[i]:
		B.append(A[i][0])

C = set(B)

if len(C) == len(B):
	print("IMPOSSIBLE")
else:
	print("POSSIBLE")
Buggy python submission (verdict: Runtime Error):
import sys

N, K = map(int, input().split())
A = list(map(int, input().split()))
maxA = max(A)
if K > maxA:
	print("IMPOSSIBLE")
	sys.exit()

def GCD(a,b):
	if b == 0:
		return a
	return GCD(b,a%b)

for i in range(1,N):
	if i == 1:
		temp = GCD(A[0],A[1])
	else:
		temp = GCD(temp, A[i])

if temp == 1:
	ans = "POSSIBLE"
else:
	if K//temp == 0:
		ans = "POSSIBLE"
	else:
		ans = "IMPOSSIBLE"

print(ans)


Fixed submission:
import sys

N, K = map(int, input().split())
A = list(map(int, input().split()))
maxA = max(A)
if K > maxA:
	print("IMPOSSIBLE")
	sys.exit()

if K in A:
	print("POSSIBLE")
	sys.exit()

def GCD(a,b):
	if b == 0:
		return a
	return GCD(b,a%b)

for i in range(1,N):
	if i == 1:
		temp = GCD(A[0],A[1])
	else:
		temp = GCD(temp, A[i])

if K % temp == 0:
	ans = "POSSIBLE"
else:
	ans = "IMPOSSIBLE"
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=sorted([int(input()) for _ in range(N)])

tot=sum(A)
if tot%10!=0:
    print(tot)
    sys.exit()
else:
    for i in range(N):
        if A[i]%10!=0:
            print(tot-A[i])
            sys.exit()
print(0)



Fixed submission:
import sys
N=int(input())
A=sorted([int(input()) for _ in range(N)])

tot=sum(A)
if tot%10 != 0:
    print(tot)
    sys.exit()
else:
    for i in range(N):
        if A[i]%10 != 0:
            print(tot-A[i])
            sys.exit()
print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

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

def solve(R_ite, L_ite, n):
	heapq.heapify(R_ite)
	heapq.heapify(L_ite)

	for _ in range(n):
		heapq.heappop(R_ite)
	for _ in range(N-n):
		heapq.heappop(L_ite)

	return sum(R_ite) + sum(L_ite)

ans = float("inf") * (-1)
for i in range(N+1):
	R = A[:N+i]
	LL = A[N+i:]
	L = [LL[j] * (-1) for j in range(len(LL))]

	ans = max(ans,solve(R,L,i))

print(ans)

Fixed submission:
import heapq

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

pre = A[:N]
epi = A[2*N:]
epi = [epi[j]*(-1) for j in range(N)]
t_pre = sum(pre)
t_epi = sum(epi)

heapq.heapify(pre)
heapq.heapify(epi)

pre_sum = []
epi_sum = []

pre_sum.append(t_pre)

for i in range(N):
	t_push = A[N+i]
	heapq.heappush(pre, t_push)
	t_pop = heapq.heappop(pre)
	t_pre = t_pre + t_push - t_pop
	pre_sum.append(t_pre)


epi_sum.append(t_epi)

for i in range(N):
	t_push = A[-(N+i+1)] * (-1)
	heapq.heappush(epi, t_push)
	t_pop = heapq.heappop(epi)
	t_epi = t_epi + t_push - t_pop
	epi_sum.append(t_epi)

epi_sum = [epi_sum[-i] for i in range(1,N+2)]
ans = []

for i in range(N+1):
	ans.append(pre_sum[i]+epi_sum[i])

print(max(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import heapq

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

def solve(R_ite, L_ite, n):
	heapq.heapify(R_ite)
	heapq.heapify(L_ite)

	for _ in range(n):
		heapq.heappop(R_ite)
	for _ in range(N-n):
		heapq.heappop(L_ite)

	return sum(R_ite) + sum(L_ite)

ans = float("inf") * (-1)
for i in range(N+1):
	R = A[:N+i]
	LL = A[N+i:]
	L = [LL[j] * (-1) for j in range(len(LL))]

	ans = max(ans,solve(R,L,i))

print(ans)

Fixed submission:
import heapq

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

pre = A[:N]
epi = A[2*N:]
epi = [epi[j]*(-1) for j in range(N)]
t_pre = sum(pre)
t_epi = sum(epi)

heapq.heapify(pre)
heapq.heapify(epi)

pre_sum = []
epi_sum = []

pre_sum.append(t_pre)

for i in range(N):
	t_push = A[N+i]
	heapq.heappush(pre, t_push)
	t_pop = heapq.heappop(pre)
	t_pre = t_pre + t_push - t_pop
	pre_sum.append(t_pre)


epi_sum.append(t_epi)

for i in range(N):
	t_push = A[-(N+i+1)] * (-1)
	heapq.heappush(epi, t_push)
	t_pop = heapq.heappop(epi)
	t_epi = t_epi + t_push - t_pop
	epi_sum.append(t_epi)

epi_sum = [epi_sum[-i] for i in range(1,N+2)]
ans = []

for i in range(N+1):
	ans.append(pre_sum[i]+epi_sum[i])

print(max(ans))
Buggy python submission (verdict: Runtime Error):
a, b, c = input().split()
if a[len(a)] == b[0] and b[len(b)] == b[0]:
    print("YES")
else:
    print("NO")

Fixed submission:
a, b, c = input().split()

print("YES") if a[len(a)-1] == b[0] and b[len(b)-1] == c[0] else print("NO")
Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
p = [o[i]+e[i] for i in range(len(o))]
print("".join(p))

Fixed submission:
o = input()
e = input()
if len(o) == len(e):
    print("".join([o[i]+e[i] for i in range(len(o))]))
else:
    print("".join([o[i]+e[i] for i in range(len(e))]+[o[len(o)-1]]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
for i in range(1,n+1):
    ans*=i
print(ans%(1000000007))

Fixed submission:
n = int(input())
ans = 1
for i in range(1,n+1):
    ans = (ans*i)%1000000007
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())

print("ABC") if x < 1200 else print("ARC")

Fixed submission:
a = int(input())

print("ABC") if a < 1200 else print("ARC")
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int, input())

print(max([a*b,c*d]))

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

print(max([a*b,c*d]))
Buggy python submission (verdict: Runtime Error):
s,k=map(int,input().split())
cnt = 0
for x in range(k+1):
    for y in range(y+1):
        if 0 <= s-(x+y) <= 2500:
            cnt+=1
print(cnt)


Fixed submission:
k, s = map(int, input().split())
c = 0

for i in range(k+1):
    for j in range(k+1):
        z = s - i - j
        if z >= 0 and z <= k:
            c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
cnt = 0
for x in range(k+1):
    for y in range(x,k+1):
        for z in range(y,k+1):
            if x+y+z == s:
                if x==y==z:
                    cnt+=1
                elif (x==y and x!=z) or (x!=y and x==z) or (x!=y and y==z):
                    cnt+=3
                else:
                    cnt+=6
print(cnt)

Fixed submission:
k, s = map(int, input().split())
c = 0

for i in range(k+1):
    for j in range(k+1):
        z = s - i - j
        if z >= 0 and z <= k:
            c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
cnt = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z == s:
                cnt += 1
print(cnt)

Fixed submission:
k, s = map(int, input().split())
c = 0

for i in range(k+1):
    for j in range(k+1):
        z = s - i - j
        if z >= 0 and z <= k:
            c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
print("vowel") if input() in ["a","i","u","e","o"] else print("consonant
")

Fixed submission:
print("vowel") if input() in ["a","i","u","e","o"] else print("consonant")
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
c=[]
for _ in range(h):
    c.append(list(map(str,input())))
    
ans=[c[i//2] for i in range(2h)]

for j in ans:
    print(''.join(j))

Fixed submission:
h,w=map(int,input().split())
c=[]
for _ in range(h):
    c.append(list(map(str,input())))
    
ans=[c[i//2] for i in range(2*h)]

for j in ans:
    print(''.join(j))
Buggy python submission (verdict: Runtime Error):
N,A=map(int,input().split())
a=list(map(int,input().split())
cnt=0
for i in range(1,N):
    tmp=max(0,(a[i-1]+a[i])-A)
    cnt+=tmp
    a[i]-=tmp
    
print(cnt)

Fixed submission:
N,A=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
for i in range(1,N):
    tmp=max(0,(a[i-1]+a[i])-A)
    if i==1:
        if a[1]<tmp:
            a[0]-=tmp-a[1]
            a[1]=0
            cnt+=tmp
            continue
    
    cnt+=tmp
    a[i]-=tmp
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
w,h,n=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]

xmin,ymin=0
xmax=w
ymax=h

for i in range(n):
    if a[i][2]==1:
        xmin=max([xmin,a[i][0]])
    elif a[i][2]==2:
        xmax=min([xmax,a[i][0]])
    elif a[i][2]==3:
        ymin=max([ymin,a[i][1]])
    else:
        ymax=min([ymax,a[i][1]])
ptint((xmax-xmin)*(ymax-ymin))

Fixed submission:
w,h,n = map(int,input().split())
l = [list(map(int,input().split())) for _ in range(n)]
xmin = 0
ymin = 0
xmax = w
ymax = h
for i in range(n):
    if l[i][2] == 1:
        xmin = max([xmin,l[i][0]])
    elif l[i][2] == 2:
        xmax = min([xmax,l[i][0]])
    elif l[i][2] == 3:
        ymin = max([ymin,l[i][1]])
    elif l[i][2] == 4:
        ymax = min([ymax,l[i][1]])
if xmax <= xmin or ymax <= ymin:
    print(0)
else:
    print((xmax - xmin) * (ymax - ymin))
Buggy python submission (verdict: Time Limit Exceeded):
N, A = map(int, input().split())
L = list(map(int, input().split()))

ans = 0

def dfs(sum,i,cnt):
	if i == N:
		if cnt != 0 and sum / cnt == A:
			return 1
		else:
			return 0

	return dfs(sum+L[i], i+1, cnt+1) + dfs(sum, i+1, cnt)


print(dfs(0,0,0))


Fixed submission:
import sys
import numpy as np
N, A = map(int, input().split())
X = np.array(list(map(int, input().split())))
x = X - A
R = 5001
dp = np.zeros([N, R], np.int64)
dp[0][(R-1)//2] += 1
dp[0][(R-1)//2 + x[0]] += 1

for i in range(1,N):
	for j in range(R):
		if 0 <= j-x[i] <= R-1:
			dp[i][j] = dp[i-1][j] + dp[i-1][j-x[i]]
		else:
			dp[i][j] = dp[i-1][j]
print(dp[N-1][(R-1)//2]-1)
Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split())
if s.count(5)==2 and s.count(7)==1:
	print("YES")
else:
    print("NO")

Fixed submission:
s = list(map(int, input().split()))
if s.count(5)==2 and s.count(7)==1:
	print("YES")
else:
    print("NO")