Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10

	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Fixed submission:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
min_r = 10
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10

	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Buggy python submission (verdict: Runtime Error):
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10
		
	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Fixed submission:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
min_r = 10
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10

	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Buggy python submission (verdict: Runtime Error):
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10
		
	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	print(min_r,min_d,i,sm)


print(sm - (10-min_r))

Fixed submission:
A = [0]*5
for i in range(5):
	A[i] = int(input())

mi = 10
sm = 0
min_r = 10
for i in range(5):
	d = A[i] // 10
	r = A[i] % 10
	if r == 0:
		sm += (d)*10
	else:
		sm += (d+1)*10

	if r != 0 and min(mi,r) < mi:
		mi = min(mi,r)
		idx = i
		min_r = r
		min_d = d
	#print(min_r,min_d,i,sm)


print(sm - (10-min_r))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
#11011010001011
l = len(s)
while True:
	s2 = s.replace("10","").replace("01","")
	if s == s2:
		break
	s = s2



print(l - len(s))

Fixed submission:
s = input()
#11011010001011
c = max(s.count("1") - s.count("0"),s.count("0") - s.count("1"))

if len(s) == 1:
	print(0)
else:
	print(len(s)-c)
Buggy python submission (verdict: Runtime Error):
N,M = map(int, input().split())
A = [input().split() for _ in range(N)]

B = [0]*30

for i in range(N):
	for j in range(int(A[i][0])):
		#print(i,j)
		B[int(A[i][j])] += 1

print(B.count(N)) 


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

B = [0]*30

for i in range(N):
	K, *A = map(int, input().split())
	for a in A:
		B[a-1] += 1

print(sum(c == N for c in B))

Buggy python submission (verdict: Runtime Error):
N,M = map(int, input().split())
A = [input().split() for _ in range(N)]

B = [0]*30

for i in range(N):
	for j in range(int(A[i][0])):
		print(i,j)
		B[int(A[i][j])] += 1

print(B.count(N)) 


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

B = [0]*30

for i in range(N):
	K, *A = map(int, input().split())
	for a in A:
		B[a-1] += 1

print(sum(c == N for c in B))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

cnt = 0
for i in range(len(s)):
	if s[i] == "B":
		cnt += s[i:].count("W")

print(cnt)

Fixed submission:

s = input()
ans = 0
tmp = 0
#saving the number of black
for c in reversed(s):
    if c == 'W':
        tmp += 1
    else:
        ans += tmp
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = [int(input()) for i in range(N)]

H.sort()
ans = float("inf")
for i in range(len(H)-K+1):
	ans = min(ans, max(H[i:i+K])- min(H[i:i+K]))

print(ans)

Fixed submission:
N, K = map(int, input().split())
H = [int(input()) for i in range(N)]

H.sort()
ans = float("inf")
for i in range(N-K+1):
	ans = min(ans, H[i+K-1]-H[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
A = [int(i) for i in input().split()]

A.sort()
ans = 0

for i in A:
    x -= a
    if x >= 0:
        ans += 1
    else:
        break
if x > 0:
    ans -= 1
print(ans)



Fixed submission:
n, x = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
ans = 0
for a in A:
    x -= a
    if x >= 0:
        ans += 1
    else:
        break
if x > 0:
    ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
A = [int(i) for i in input().split()]

A.sort()
ans = []
for i in A:
	if x < i:
		break
	ans += 1
	x -= i
	else:
		break

if x > 0:
		ans -= 1
print(ans)


Fixed submission:
n, x = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
ans = 0
for a in A:
    x -= a
    if x >= 0:
        ans += 1
    else:
        break
if x > 0:
    ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
A = [int(i) for i in input().split()]

A.sort()
ans = []
for i in A:
	if x < i:
		break
	ans += 1
	x -= i
else:
	break

if x > 0:
		ans -= 1
print(ans)

Fixed submission:
n, x = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
ans = 0
for a in A:
    x -= a
    if x >= 0:
        ans += 1
    else:
        break
if x > 0:
    ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N, x = map(int, input().split())
A = [int(i) for i in input().split()]

A.sort()
ans = []
for i in A:
	if x < i:
		break
	ans += 1
	x -= i

else:
	if x > 0:
		ans -= 1
print(ans)



Fixed submission:
n, x = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
ans = 0
for a in A:
    x -= a
    if x >= 0:
        ans += 1
    else:
        break
if x > 0:
    ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
D,N = map(int,input().split())
0 5
A = [int(i) for i in range(1,100)] + [101]
B = [int(i*100) for i in range(1,100)] + [10001]
C = [int(i*10000) for i in range(1,101)] + [10000001]

if D == 0:
	print(A[N-1])
elif D == 1:
	print(B[N-1])
else:
	print(C[N-1])

Fixed submission:
D,N = map(int,input().split())
A = [int(i) for i in range(1,100)] + [101]
B = [int(i*100) for i in range(1,100)] + [10100]
C = [int(i*10000) for i in range(1,100)] + [1010000]

if D == 0:
	print(A[N-1])
elif D == 1:
	print(B[N-1])
else:
	print(C[N-1])

Buggy python submission (verdict: Runtime Error):
D,N = map(int,input().split())
#0 5
A = [int(i) for i in range(1,100)]
B = [int(i*100) for i in range(1,100)]
C = [int(i*10000) for i in range(1,100)]

if D == 0:
	print(A[N-1])
elif D == 1:
	print(B[N-1])
else:
	print(C[N-1])

Fixed submission:
D,N = map(int,input().split())
A = [int(i) for i in range(1,100)] + [101]
B = [int(i*100) for i in range(1,100)] + [10100]
C = [int(i*10000) for i in range(1,100)] + [1010000]

if D == 0:
	print(A[N-1])
elif D == 1:
	print(B[N-1])
else:
	print(C[N-1])
Buggy python submission (verdict: Runtime Error):
for i in range(K):
	A2 = B + C
	B2 = C + A
	C2 = A + B	

	A,B,C = A2, B2, C2


if abs(A-B) > 10**18:
	print(Unfair)
else:
	print(A-B)

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

if K % 2 == 0:
	print(A-B) if abs(A-B)<=10**18 else print("Unfair")
else:
	print(B-A) if abs(A-B)<=10**18 else print("Unfair")
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
S = list(range(A,B+1))

S2 = sorted(set(S[:K]+S[-K:]))

for s in S2:
	print(s)

Fixed submission:
A,B,K = map(int,input().split())
S = []
#list(range(A,B+1))
for i in range(K):
	S.append(A+i)
	S.append(B-i)

S = sorted(list(set(S)))

for i in range(len(S)):
	if A<=S[i]<=B:
		print(S[i])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
S = list(range(A,B+1))

S2 = set(S[:K]+S[-K:])
S3 = sorted(S2)

for s in S3:
	print(s)

Fixed submission:
A,B,K = map(int,input().split())
S = []
#list(range(A,B+1))
for i in range(K):
	S.append(A+i)
	S.append(B-i)

S = sorted(list(set(S)))

for i in range(len(S)):
	if A<=S[i]<=B:
		print(S[i])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
S = list(range(A,B+1))

S2 = set(S[:K]+S[-K:])
S3 = sorted(S2)

for s in S3:
	print(s)

#print("\n".join(S3))

Fixed submission:
A,B,K = map(int,input().split())
S = []
#list(range(A,B+1))
for i in range(K):
	S.append(A+i)
	S.append(B-i)

S = sorted(list(set(S)))

for i in range(len(S)):
	if A<=S[i]<=B:
		print(S[i])

Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())

l = list(range(A,B+1))
if K >= len(l):
	for i in l:
		print(i)

a1 = l[:K]
a2 = l[len(l)-K:]

a3 = sorted(list(set(a1 + a2)))

for i in a3:
	print(i)

Fixed submission:
A,B,K = map(int,input().split())
S = []
#list(range(A,B+1))
for i in range(K):
	S.append(A+i)
	S.append(B-i)

S = sorted(list(set(S)))

for i in range(len(S)):
	if A<=S[i]<=B:
		print(S[i])
Buggy python submission (verdict: Time Limit Exceeded):
#a,b,c, = map(int,input().split())

a = list(map(int,input().split()))
a.sort(reverse=True)

cnt = 0
while True:
	if a[0] == a[1] == a[2]:
		break
	elif a[0] == a[1] > a[2]:
		if (a[0] - a[2])%2 == 0:
			cnt += (a[0] - a[2])//2
			a[2] = a[0]
		else:
			cnt += (a[0]+1 - a[2])//2
			cnt += 1
			a[0] += 1
			a[1] += 1
			a[2] = a[0]
	elif a[0] > a[1] > a[2]:
		a[1] += 1
		a[2] += 1
		cnt += 1

print(cnt)


Fixed submission:
#和を求める解法
a,b,c = map(int,input().split(" "))
sum = a+b+c
max = max(a,b,c)
if (sum - max)%2 == 0:
    print(int((max*3 - sum)/2))
else:
    print(int(((max+1)*3 - sum)/2))
Buggy python submission (verdict: Runtime Error):
s = input()
A = int(s[0])
B = int(s[1])
C = int(s[2])
D = int(s[3])

if A+B+C+D == 7:
	print("{0}+{1}+{2}+{3}=7".format(A,B,C,D))
elif A+B+C-D == 7:
	print("{0}+{1}+{2}-{3}=7".format(A,B,C,D))
elif A+B-C-D == 7:
	print("{0}-{1}+{2}-{3}=7".format(A,B,C,D))
elif A+B-C+D == 7:
	print("{0}+{1}-{2}+{3}=7".format(A,B,C,D))
elif A-B+C+D == 7:
	print("{0}-{1}+{2}+{3}=7".format(A,B,C,D))
elif A-B+C-D == 7:
	print("{0}-{1}+{2}-{3}=7".format(A,B,C,D))
elif A-B-C-D == 7:
	print("{0}-{1}-{2}-{3}=7".format(A,B,C,D))
else A-B-C+D == 7:
	print("{0}-{1}-{2}+{3}=7".format(A,B,C,D))

Fixed submission:
s = input()
A = int(s[0])
B = int(s[1])
C = int(s[2])
D = int(s[3])

if A+B+C+D == 7:
	print("{0}+{1}+{2}+{3}=7".format(A,B,C,D))
elif A+B+C-D == 7:
	print("{0}+{1}+{2}-{3}=7".format(A,B,C,D))
elif A+B-C-D == 7:
	print("{0}+{1}-{2}-{3}=7".format(A,B,C,D))
elif A+B-C+D == 7:
	print("{0}+{1}-{2}+{3}=7".format(A,B,C,D))
elif A-B+C+D == 7:
	print("{0}-{1}+{2}+{3}=7".format(A,B,C,D))
elif A-B+C-D == 7:
	print("{0}-{1}+{2}-{3}=7".format(A,B,C,D))
elif A-B-C-D == 7:
	print("{0}-{1}-{2}-{3}=7".format(A,B,C,D))
elif A-B-C+D == 7:
	print("{0}-{1}-{2}+{3}=7".format(A,B,C,D))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())

def even(a):
	if a % 2 == 0:
		return True
	else:
		return False

if A == B and B == C:
	print("-1")
elif:
	if not (even(A) and even(B) and even(C)):
		print("0")
		
else:
	cnt = 0
	while even(A) and even(B) and even(C):
		tmp1, tmp2, tmp3 = A,B,C
		A = (tmp2+tmp3) // 2
		B = (tmp3+tmp1) // 2
		C = (tmp1+tmp2) // 2
		cnt += 1
	print(cnt)


Fixed submission:
l = list(map(int, input().split()))
ans = 0
while( l[0]%2==0 and l[1]%2==0 and l[2]%2==0):
    if l[0]==l[1]and l[1]==l[2]:
        ans = -1
        break
    else:
        a = l[0]
        b = l[1]
        c = l[2]
        l[0]=(b+c)/2
        l[1]=(a+c)/2
        l[2]=(a+b)/2
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
if A>B:
  print("GREATER")
elif A < B:
  print("LESS")
else:
  print("EQUAL")

Fixed submission:
A = int(input())
B = int(input())

if A>B:
  print("GREATER")
elif A < B:
  print("LESS")
else:
  print("EQUAL")
Buggy python submission (verdict: Runtime Error):
N,L = map(int,input().split())
S = [input() for i in range(N)]
print("".join(S.sort()))

Fixed submission:
N,L = map(int,input().split())
S = [input() for i in range(N)]
S.sort()
print("".join(S))
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
p = list(map(int,input().split()))
c = list(map(int,input().split()))
was = [False]*n
sums = []
for i in range(n):
    if not was[i]:
        iWas = [False]*n
        pos = i
        sumn = [c[i]]
        while not iWas[pos]:
            iWas[pos] = True
            was[pos] = True
            pos = p[pos]-1
            sumn+=[c[pos]]
        sumn = sumn[:-1]
        sums.append(sumn)
m = -9999999999999999999999999
for i in range(len(sums)):
    totS = sum(sums[i])
    l = len(sums[i])
    for g in range(len(sums[i])):
        arr = []
        s = 0
        for j in range(l):
            s+=sums[i][(g+j)%l]
            arr.append(s)

        if totS > 1:
            add = max(arr[:k%l]+[-99999999999999999999])
            if add != -99999999999999999999:
                m = max(m,totS*(k//l)+max(max(arr[:k%l]),0))
            else:
                m = max(m,totS*(k//l))

        else:

            m = max(m, max(arr[:min(l,k)]))
print(m)




Fixed submission:
t = input()
if "RRR" in t:
    print(3)
elif "RR" in t:
    print(2)
elif "R" in t:
    print(1)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
x,k,d = list(map(int,input().split()))
x = abs(x)
mst = x//d
if mst&1 != k&1:
    mst+=1
print(abs(x-(min(mst,k))*d))

Fixed submission:
t = input()
if "RRR" in t:
    print(3)
elif "RR" in t:
    print(2)
elif "R" in t:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
x,k,d = list(map(int,input().split()))
c = x//d
if c >= k:
    print(x-k*d)
else:
    x = x%(c*d)
    k-=c
    if k&1:
        print(abs(x-d))
    else:
        if x < abs(x-d):
            print(x)
        else:
            print(abs(x-d))

Fixed submission:
x,k,d = list(map(int,input().split()))
x = abs(x)
mst = x//d
if mst&1 != k&1:
    mst+=1
print(abs(x-(min(mst,k))*d))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
now = 1
for i in range(k):
    now*=a[i]
for i in range(k,n):
    new = (now/a[i-k])*a[i]
    if now < new:
        print("Yes")
    else:
        print("No")
    now = new

Fixed submission:
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
for i in range(k,n):
    if a[i-k] < a[i]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
now = 1
for i in range(k):
    now*=a[i]
for i in range(k,n):
    if now < (now/a[i-k])*a[i]:
        print("Yes")
    else:
        print("No")
    now = (now/a[i-k])*a[i]

Fixed submission:
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
for i in range(k,n):
    if a[i-k] < a[i]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
for i in range(am):
	if arr[i]>=1/(4*am):
      got+=1
if got >=n:
	print("YES")
else:
  print("NO")

Fixed submission:
am,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
got = 0
s = sum(arr)
for i in range(am):
    if arr[i]>=s*(1/(4*n)):
        got+=1
if got >=n:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):

def main():
    n = int(input())
    s = bytearray(input().encode())
    q = int(input())
    for _ in range(q):
        t, a, b = [p for p in input().split()]
        t = int(t)
        a = int(a)
        if t == 1:
            s[a-1] = b.encode()[0]
        else:
            b = int(b)
            c = set(s[a-1:b])
            print(len(c))

main()



Fixed submission:
import bisect

def main():
    n = int(input())
    s = bytearray(input().encode())
    q = int(input())

    alpha = [ord('a')+i for i in range(26)]
    alpha_map = {c: [] for c in alpha}
    for i, c in enumerate(s):
        bisect.insort(alpha_map[c], i+1)

    for _ in range(q):
        t, a, b = [p for p in input().split()]
        t = int(t)
        a = int(a)
        if t == 1:
            char = s[a-1]
            b = ord(b)
            if char == b:
                continue
            src_lst = alpha_map[char]
            dst_lst = alpha_map[b]
            idx = bisect.bisect_left(src_lst, a)
            if idx < len(src_lst):
                src_lst.pop(idx)
            bisect.insort(dst_lst, a)
            s[a-1] = b
        else:
            b = int(b)
            cnt = 0
            for _, lst in alpha_map.items():
                idx = bisect.bisect_left(lst, a)
                if idx < len(lst) and lst[idx] <= b:
                    cnt +=1
            print(cnt)
main()
Buggy python submission (verdict: Runtime Error):
 = [[0 for x in range(1)]for y in range(3)]
one_count = 0
two_count = 0
three_count = 0
four_count = 0
for i in range(3):
     A[i] = [int(x) for x in input().split()]

     if(A[i][0]==1 or A[i][1]==1):
         one_count += 1
     if(A[i][0]==2 or A[i][1]==2):
         two_count += 1
     if(A[i][0]==3 or A[i][1]==3):
         three_count += 1
     if(A[i][0]==4 or A[i][1]==4):
         four_count += 1

if(one_count >= 3 or two_count >= 3 or three_count >= 3 or four_count >= 3):
    print("NO")
else:
    print("YES")



Fixed submission:
A = [[0 for x in range(1)]for y in range(3)]
one_count = 0
two_count = 0
three_count = 0
four_count = 0
for i in range(3):
     A[i] = [int(x) for x in input().split()]

     if(A[i][0]==1 or A[i][1]==1):
         one_count += 1
     if(A[i][0]==2 or A[i][1]==2):
         two_count += 1
     if(A[i][0]==3 or A[i][1]==3):
         three_count += 1
     if(A[i][0]==4 or A[i][1]==4):
         four_count += 1

if(one_count >= 3 or two_count >= 3 or three_count >= 3 or four_count >= 3):
    print("NO")
else:
    print("YES")

Buggy python submission (verdict: Runtime Error):
 = [[0 for x in range(1)]for y in range(3)]
one_count = 0
two_count = 0
three_count = 0
four_count = 0
for i in range(3):
     A[i] = [int(x) for x in input().split()]

     if(A[i][0]==1 or A[i][1]==1):
         one_count += 1
     if(A[i][0]==2 or A[i][1]==2):
         two_count += 1
     if(A[i][0]==3 or A[i][1]==3):
         three_count += 1
     if(A[i][0]==1 or A[i][1]==1):
         four_count += 1

if(one_count >= 3 or two_count >= 3 or three_count >= 3 or four_count >= 3):
    print("NO")
else:
    print("YES")



Fixed submission:
A = [[0 for x in range(1)]for y in range(3)]
one_count = 0
two_count = 0
three_count = 0
four_count = 0
for i in range(3):
     A[i] = [int(x) for x in input().split()]

     if(A[i][0]==1 or A[i][1]==1):
         one_count += 1
     if(A[i][0]==2 or A[i][1]==2):
         two_count += 1
     if(A[i][0]==3 or A[i][1]==3):
         three_count += 1
     if(A[i][0]==4 or A[i][1]==4):
         four_count += 1

if(one_count >= 3 or two_count >= 3 or three_count >= 3 or four_count >= 3):
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Runtime Error):
N = int(input())
h = [int(x) for x in input().split()]
dp = [0]*N

for i in range(1,N):
  	if i==1:
      	dp[i] = abs(h[1]-h[0])
    elif i>1:
      	dp[i] = min(abs(h[i]-h[i-1])+dp[i-1],abs(h[i]-h[i-2])+dp[i-2])
    
print(dp[N-1])

Fixed submission:
N = int(input())
h = [int(x) for x in input().split()]
dp = [0]*N

for i in range(1,N):
    if i==1:
        dp[i] = abs(h[1]-h[0])
    elif i>1:
        dp[i] = min(abs(h[i]-h[i-1])+dp[i-1],abs(h[i]-h[i-2])+dp[i-2])

print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
a = input()
b = 0
if a == "SAT"
    b = 1
if a == "SUN"
    b = 7
if a == "MON"
    b = 6
if a == "TUE"
    b = 5
if a == "WED"
    b = 4
if a == "THU"
    b = 3
if a == "FRI"
    b = 2
print(b)

Fixed submission:
a = input()
b = 0
if a == "SAT":
    b = 1
if a == "SUN":
    b = 7
if a == "MON":
    b = 6
if a == "TUE":
    b = 5
if a == "WED":
    b = 4
if a == "THU":
    b = 3
if a == "FRI":
    b = 2
print(b)

Buggy python submission (verdict: Runtime Error):
a = input()
b = ""
if a == "SAT"
    b = 1
if a == "SUN"
    b = 7
if a == "MON"
    b = 6
if a == "TUE"
    b = 5
if a == "WED"
    b = 4
if a == "THU"
    b = 3
if a == "FRI"
    b = 2
return b

Fixed submission:
a = input()
b = 0
if a == "SAT":
    b = 1
if a == "SUN":
    b = 7
if a == "MON":
    b = 6
if a == "TUE":
    b = 5
if a == "WED":
    b = 4
if a == "THU":
    b = 3
if a == "FRI":
    b = 2
print(b)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 入力
A, op, B = input().split()
if op == '+':
    print(A + B)
else:
    print(A - B)

Fixed submission:
# -*- coding: utf-8 -*-
# 入力
A, op, B = input().split()
if op == '+':
    print(int(A) + int(B))
else:
    print(int(A) - int(B))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 入力
N = int(input())
T = map(int, input().split())
M = int(input())
for i in range(0, M):
    p, x = map(int, input().split())
    Time = sum(T) - T[p - 1] + x
    print(Time)

Fixed submission:
# -*- coding: utf-8 -*-
# 入力
N = int(input())
T = input().split()
for i in range(0, N):
    T[i] = int(T[i])
M = int(input())
for i in range(0, M):
    p, x = input().split()
    p = int(p)
    x = int(x)
    Time = sum(T) - T[p - 1] + x
    print(Time)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
for i in range(n):
    if(s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C"):
        cnt +=1
print(cnt)                

Fixed submission:
n = int(input())
s = input()
cnt = 0
for i in range(n-2):
    if(s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C"):
        cnt +=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

cnt = 0

for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
         if   i + j + k == S:
            cnt += 1

print(cnt)

Fixed submission:
K, S = map(int, input().split())

cnt = 0

for i in range(K+1):
    for j in range(K+1):
        z = S - i - j
        if 0 <= z <= K:
            cnt += 1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
mul = 1
lst = list(map(int,input().split()))
for ele in lst:
  mul = mul *ele
if(mul > 1e18):
  print(-1)
else:
  print(mul)


Fixed submission:
def solve():
    n = int(input())
    lst = list(map(int,input().split()))
    if 0 in lst:
        print(0)
        return
    mul = 1
    for ele in lst:
        mul = mul * ele
        if mul > 1e18:
            print(-1)
            return
    
    print(mul)
    
solve()

Buggy python submission (verdict: Runtime Error):
n = int(input())
mul = 1
lst = [map(int.input().split())]
for ele in lst:
  mul = mul *ele
if(mul > 1e18):
  print(-1)
else:
  print(mul)

Fixed submission:
def solve():
    n = int(input())
    lst = list(map(int,input().split()))
    if 0 in lst:
        print(0)
        return
    mul = 1
    for ele in lst:
        mul = mul * ele
        if mul > 1e18:
            print(-1)
            return
    
    print(mul)
    
solve()