Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
YOUBI = input()
if YOUBI == "MON":
  print"6"
if YOUBI == "TUE":
  print"5"
if YOUBI == "WED":
  print"4"
if YOUBI == "THU":
  print"3"
if YOUBI == "FRI":
  print"2" 
if YOUBI == "SAT":
  print"1"
if YOUBI == "SUN":
   print"7"
    
    
   

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

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

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

Buggy python submission (verdict: Runtime Error):
YOUBI = input()
if YOUBI == "MON

Fixed submission:
YOUBI = input()
if YOUBI == "MON":
  print(6)
if YOUBI == "TUE":
  print(5)
if YOUBI == "WED":
  print(4)
if YOUBI == "THU":
  print(3)
if YOUBI == "FRI":
  print(2) 
if YOUBI == "SAT":
  print(1)
if YOUBI == "SUN":
   print(7)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(max(A- 2*b, 0))

Fixed submission:
A, B = map(int, input().split())
print(max(A- 2*B, 0))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

def main():
    N = int(input())
    L = [int(i) for i in input().split()]
    L.sort()
    count = 0
    for i in range(N-2):
        for j in range(i+1, N-1):
            k = bisect.bisect_left(L, L[i] + L[j])
            k -= 1
            while k != j:
                if L[i] < L[j] + L[k] and L[j] < L[i] + L[k]:
                    count += 1
                k -= 1
    print(count)


if __name__ == "__main__":
    main() 


Fixed submission:
import bisect

def main():
    N = int(input())
    L = [int(i) for i in input().split()]
    L.sort()
    count = 0
    for i in range(N-2):
        for j in range(i+1, N-1):
            k = bisect.bisect_left(L, L[i] + L[j])
            k -= 1
            count += k - j
    print(count)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
input()
foods=list(map(int,input().split()))
ans = 0
sum = 0
for i in foods:
    for j in foods:
        i<j
        ans= foods[i]*foods[j]
        sum += ans
print(sum)

Fixed submission:
n=int(input())
foods=list(map(int,input().split()))
ans = 0
sum_ans = 0
for i in range(0,n-1):
    for j in range(1,n):
        if i<j:
            ans = foods[i]*foods[j]
            sum_ans += ans
print(sum_ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
seqs =list(map(int,input().split()))
count = 0
for i in range(1,n+1):
    if i != seqs[i]:
        count += 1
if count <= 2:
    print("YES")
else:
    print("NO")

Fixed submission:
a,b = map(int,input().split())
if (a-b)%2==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
for i in range(1000000000):
    if abs(a-i)==abs(b-i):
        print(i)
else:
    print("IMPOSSIBLE")

Fixed submission:
a,b = map(int,input().split())
if (a-b)%2==0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n=int(input())
seqs =list(map(int,input().split()))
count = 0
for i in range(1,n+1):
    if i != seqs[i]:
        count += 1
if count <= 2:
    print("YES")
else:
    print("NO")

Fixed submission:
n=int(input())
seqs =list(map(int,input().split()))
count = 0
for i in range(n):
    if i+1 != seqs[i]:
        count += 1
if count <= 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
import math 
N,D = map(int,input().split())
X=[]
count=0
for i in range(N):
    x = list(map(int,input().split()))
    X.append(x)
for i in range(N-1):
    for j in range(i,N):
        s = 0
        for k in range(N):
            s += (X[i][k]-X[j][k])**2
            if math.sqrt(s).is_integer():
                count += 1
print(count)

Fixed submission:
import math 
N,D = map(int,input().split())
X=[]
count=0
for i in range(N):
    x = list(map(int,input().split()))
    X.append(x)
for i in range(N-1):
    for j in range(i+1,N):
        s = 0
        for k in range(D):
            s += (X[i][k]-X[j][k])**2
        if math.sqrt(s).is_integer():
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
b=input()

if b=="A":
    print("T")
if b=="C":
    print("G")
if b=-G:
    print("C")
if b==T:
    print("A")

Fixed submission:
b=input()

if b=="A":
    print("T")
if b=="C":
    print("G")
if b=="G":
    print("C")
if b=="T":
    print("A")
Buggy python submission (verdict: Runtime Error):
H=input()
W=input()
h=input()
w=input()

H=int(H)
W=int(W)
h=int(h)
w=int(w)

print(H*W-w*H-h*W+w*h)

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

Buggy python submission (verdict: Runtime Error):
H=input()
W=input()
h=input()
w=input()

H=int(H)
W=int(W)
h=int(h)
w=int(w)

print(HW-wH-hH-wh)

Fixed submission:
a,b = map(int,input().split())
c,d = map(int,input().split())
print((a-c)*(b-d))
Buggy python submission (verdict: Runtime Error):
s = input()
s.strip("/")
s = int(s)
if s <= 20190430:
    print("Heisei")
else:
    print("TBD")

Fixed submission:
s = input()
if int(s[5:7])<= 4:
    print("Heisei")
else:
    print("TBD")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input.split())

if a*b%2==1:
    print("Odd")
else:
    print("Even")

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


if (a*b)%2==0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a,b=input.split()

if a*b%2==1:
    print("Odd")
else:
    print("Even")

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


if (a*b)%2==0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input.split())

c=a*b

if c%2==0:
    print("Even")
else:
    print("Odd")

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


if (a*b)%2==0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
cmb = int(N * (N - 1) / 2)
cnt = 0
for i in range(cmb):
    for j in range(i + 1, cmb):
        cnt = cnt + d[i] * d[j]
print(cnt)

Fixed submission:
N = int(input())
d = list(map(int, input().split()))
cmb = int(N * (N - 1) / 2)
cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        cnt = cnt + d[i] * d[j]
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
score = 0
num = 0

for i in range(N):
    j = A[i] - 1
    if a[i] == j:
        score += B[j] + C[j-1]
    else:
        score += B[j]
print(score)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
score = 0

for i in range(N):
    j = A[i] - 1
    if i > 0 and A[i] - A[i-1] == 1:
        score += B[j] + C[j-1]
    else:
        score += B[j]
print(score)
Buggy python submission (verdict: Runtime Error):
i = list(map(int, input().split()))
print(i[2] - (i[0] - i[1]))
i = list(map(int, input().split()))
n = i[2] - (i[0] - i[1])
if n > 0:
    print(n)
else:
    print(0)


Fixed submission:
i = list(map(int, input().split()))
n = i[2] - (i[0] - i[1])
if n > 0:
    print(n)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
strs = list()
for _ in range(n):
    strs.append(sorted(list(input())))

total = 0
for i in range(n):
    for j in range(i + 1, n):
        if strs[i] == strs[j]:
            total += 1
print(total)


Fixed submission:
n = int(input())
d = {}

for _ in range(n):
    s = ''.join(sorted(input()))
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

ans = 0
for k, v in d.items():
    ans += (v * (v - 1)) / 2

print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
charanger_list = [K] * N
answer_list = []

# 正答者を記録
for i in range(Q):
	answer_list.append(int(input()) - 1)

# 点数計算
for answer in answer_list:
	charanger_list = [ charanger-1 for charanger in charanger_list]
	charanger_list[answer] += 1

for i in range(N):
	print('Yes' if charanger_list[i] > 0 else 'No')

Fixed submission:
N, K, Q = map(int, input().split())
charanger_points = [K] * N
gained_points = [0] * N

# 正答者を記録
for i in range(Q):
	gained_points[int(input()) - 1] += 1

# 点数計算
for i in range(N):
	charanger_points[i] -=  Q - gained_points[i]

# 提示
for i in range(N):
	print('Yes' if charanger_points[i] > 0 else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

# 割引は出来るだけする
for i in range(M):
	item_list[item_list.index(max(item_list))] = math.floor(max(item_list) / 2)

print(sum(item_list))

Fixed submission:
import heapq

N, M = map(int, input().split())
item_list = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(item_list)

# 割引は出来るだけする
for i in range(M):
	temp_min = heapq.heappop(item_list)
	heapq.heappush(item_list, (-1)*(-temp_min//2))
print(-sum(item_list))
Buggy python submission (verdict: Runtime Error):
r=int(input())
return(3*r^2)

Fixed submission:
r=int(input())
print(3*(r**2))
Buggy python submission (verdict: Runtime Error):
X=list(map(int,input().split()))[1]
L=list(map(int,input().split()))
i=0
d=0
while True:
    if d>=X:
        break
    else:
        d+= L[i]
        i+= 1
print(i+1)

Fixed submission:
N = list(map(int,input().split()))
if N[0]< N[1]:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
if (A<C and C<B) or (A>C and C>B):
    print("Yes")
else:
    print("No")


Fixed submission:
b=[int(i) for i in input().split()]
if (b[0]<b[2] and b[2]<b[1]) or (b[0]>b[2] and b[2]>b[1]):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
if (A<C and C<B) or (A>C and C>B):
    print("Yes")
else:
    print("No")

Fixed submission:
b=[int(i) for i in input().split()]
if (b[0]<b[2] and b[2]<b[1]) or (b[0]>b[2] and b[2]>b[1]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=nt(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if n % min([a,b,c,d,e]) ==0:
    res=5+ n//(min[a,b,c,d,e])
else:
    res=5+ (n//(min[a,b,c,d,e])+1)
print(res)


Fixed submission:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if n%(min([a,b,c,d,e]))==0:
    res=4+ n//(min([a,b,c,d,e]))
else:
    res=5+ n//(min([a,b,c,d,e]))
print(res)

Buggy python submission (verdict: Runtime Error):
n=nt(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if min([a,b,c,d,e])==1:
    res=5+ n//(min[a,b,c,d,e])
else:
    res=5+ (n//(min[a,b,c,d,e])+1)
print(res)

Fixed submission:
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if n%(min([a,b,c,d,e]))==0:
    res=4+ n//(min([a,b,c,d,e]))
else:
    res=5+ n//(min([a,b,c,d,e]))
print(res)
Buggy python submission (verdict: Runtime Error):
N=int(input())
b=[int(i) for i in input().split()]
import numpy as np
import math
def ordering(N,b):
    a=[]
    comb=math.factorial(N)
    x=[[]]*comb
    y=[[]]*comb
    for i in range(1,N):
        a=a+[i]
        for n,m in enumerate(a):
            x[n].insert(m-1,m)
            y[n].append(m)
    resnum=[x.index(i) for i in x if i==b]
    try:
        for i in y[resnum[0]]:
            print(i)
    except:
        return(-1)
ordering(N,b)

Fixed submission:
N=int(input())
b=[int(i) for i in input().split()]
a=[]
try:
    while len(b)>0:
        a2=max([j for i,j in enumerate(b) if b[i]==i+1])
        a.insert(0,a2)
        x=b.pop(a2-1)
    for n in a:
        print(n)
except:
    print(-1)

Buggy python submission (verdict: Runtime Error):
N=int(input())
b=[int(i) for i in input().split()]
import numpy as np
import math
def ordering(N,b):
    a=[]
    comb=math.factorial(N)
    x=[[]]*comb
    y=[[]]*comb
    for i in range(1,N):
        a=a+[i]
        for n,m in enumerate(a):
            x[n].insert(m-1,m)
            y[n].append(m)
    resnum=[x.index(i) for i in x if i==b]
    try:
        for i in y[resnum[0]]:
            print(i)
    except:
        return(-1)
print(ordering(N,b))


Fixed submission:
N=int(input())
b=[int(i) for i in input().split()]
a=[]
try:
    while len(b)>0:
        a2=max([j for i,j in enumerate(b) if b[i]==i+1])
        a.insert(0,a2)
        x=b.pop(a2-1)
    for n in a:
        print(n)
except:
    print(-1)
Buggy python submission (verdict: Runtime Error):
print(int(input()**2))

Fixed submission:
print(int(input())**2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

members = list(map(int, input().split()))
junban = []

app = junban.append

for i in range(1, N+1):
  app(members.index(i)+1)
  
for i in junban:
  print(i,end=' ')

Fixed submission:
N = int(input())
members = list(map(int, input().split()))
junban = {}

for i,member in zip(range(N), members):
  junban[member] = i+1
  
for i in junban.values():
  print(i,end=' ')

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
members = list(map(int, input().split()))
junban = []

for i in range(1, N+1):
  junban.append(members.index(i)+1)
  
for i in junban:
  print(i,end=' ')

Fixed submission:
N = int(input())
members = list(map(int, input().split()))
junban = {}

for i,member in zip(range(N), members):
  junban[member] = i+1
  
for i in junban.values():
  print(i,end=' ')
Buggy python submission (verdict: Runtime Error):
from collections import Counter
ctr = Counter()
N, M = map(int,input().split())
for _ in range(N):
  ctr.update(map(int,input().split())[1:])
print(len([None for v in ctr.values() if v == M]))

Fixed submission:
from collections import Counter
ctr = Counter()
N, M = map(int,input().split())
for _ in range(N):
  ctr.update(list(map(int,input().split()))[1:])
print(len([None for v in ctr.values() if v == N]))
Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
input()
Ai = list(map(int, input().split()))
print(reduce(gcd, Ai))

Fixed submission:
from functools import reduce
def gcd(a, b):
    if a < b:
        return gcd(b, a)
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
input()
Ai = list(map(int, input().split()))
print(reduce(gcd, Ai))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
input()
Ai = list(map(int, input().strip()))
print(reduce(gcd, Ai))

Fixed submission:
from functools import reduce
def gcd(a, b):
    if a < b:
        return gcd(b, a)
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
input()
Ai = list(map(int, input().split()))
print(reduce(gcd, Ai))
Buggy python submission (verdict: Runtime Error):
print(int(input())/int(input()))

Fixed submission:
a,b=map(int,input().split());print(a/b)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ABCs = [
  sorted(map(int, input().split()))
  for _ in range(3)
]

def table(As, Bs):
  ib = 0
  result = []
  for a in As:
    while ib < N and Bs[ib] <= a:
      ib += 1
    result.append(ib)
  return result

def table2(Bs, Cs):
  ic = 0
  result = []
  for b in Bs:
    while ic < N and Cs[ic] <= b:
      ic += 1
    result.append(N-ic)
  return result

def f(ABCs):
  AB = table(ABCs[0], ABCs[1])
  BC = table2(ABCs[1], ABCs[2])
  acc = 0
  
  for i, bmin in enumerate(AB):
      acc += sum(BC[bmin:])
  
  return acc
  
print(f(ABCs))

Fixed submission:
N = int(input())
As, Bs, Cs = [
  sorted(map(int, input().split()))
  for _ in range(3)
]

from bisect import *

def sums():
  for b in Bs:
  	yield bisect_left(As, b) * (N - bisect_right(Cs, b))

print(sum(sums()))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ABCs = [
  sorted(map(int, input().split()))
  for _ in range(3)
]

def table(As, Bs):
  ib = 0
  result = []
  for a in As:
    while ib < N and Bs[ib] <= a:
      ib += 1
    result.append(ib)
  return result

def table2(Bs, Cs):
  ic = 0
  result = []
  for b in Bs:
    while ic < N and Cs[ic] <= b:
      ic += 1
    result.append(N-ic)
  return result

def f(ABCs):
  AB = table(ABCs[0], ABCs[1])
  BC = table2(ABCs[1], ABCs[2])
  
  def Cs():
    for i, bmin in enumerate(AB):
      yield sum(BC[bmin:])
  
  return sum(Cs())
  
print(f(ABCs))

Fixed submission:
N = int(input())
As, Bs, Cs = [
  sorted(map(int, input().split()))
  for _ in range(3)
]

from bisect import *

def sums():
  for b in Bs:
  	yield bisect_left(As, b) * (N - bisect_right(Cs, b))

print(sum(sums()))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ABCs = [
  sorted(map(int, input().split()))
  for _ in range(3)
]

def table(As, Bs):
  ib = 0
  result = []
  for a in As:
    while ib < len(Bs) and Bs[ib] <= a:
      ib += 1
    result.append(ib)
  return result


def f(ABCs):
  AB = table(ABCs[0], ABCs[1])
  BC = table(ABCs[1], ABCs[2])
  return sum(
    N - BC[j]
    for i, ab in enumerate(AB)
    for j in range(ab, N)
  )
  
print(f(ABCs))

Fixed submission:
N = int(input())
As, Bs, Cs = [
  sorted(map(int, input().split()))
  for _ in range(3)
]

from bisect import *

def sums():
  for b in Bs:
  	yield bisect_left(As, b) * (N - bisect_right(Cs, b))

print(sum(sums()))
Buggy python submission (verdict: Runtime Error):
s = input()

dic = {'SUN' : 6, 'MON' : 5, 'WED' : 4, 'THU' : 3, 'FRI' : 2, 'SAT' : 1}

print(dic[s])


Fixed submission:
s = input()

dic = {
    'SUN' : 7, 'MON' : 6, 'TUE' : 5, 'WED' : 4, 'THU' : 3, 'FRI' : 2, 'SAT' : 1
}

print(dic[s])

Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
def get_price(a,b,n):
    return a * n + b * int (math.log10(n) + 1)    
a, b, x = map(int,input().split(' '))
currnt_max = 0
price_range = [get_price(a,b,10 ** i) for i in range(0,10)]    
price_range = np.asarray(price_range)

start = price_range[price_range < x].argmax()
end = 10 ** (start + 1)
start = 10 ** start
if start == 10 ** 9:
    print(10 ** 9)
    exit()

for i in range(start,10**9 + 1):
    tmp = get_price(a,b,i)
    if tmp < x:
        currnt_max = i
    else:
        break
print(currnt_max)

Fixed submission:
s = input()
day = {'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1 }
print(day[s])
Buggy python submission (verdict: Runtime Error):
import math
x,y = map(int, input().split())
n = 2 * x - y
m = 2 * y - x

ans = 0
if n % 3 == 0:
	if m % 3 == 0:
		nn = int(n / 3)
		mm= int(m / 3)
		ans = math.factorial(nn+ mm) / math.factorial(nn) * math.factorial(mm)
		ans = int(ans % ((10**9) + 7))

print(ans)

Fixed submission:
import math

MAX=1000000
MOD=1000000007

fac=[1,1]
finv=[1,1]
inv=[1,1]

for i in range(2,MAX):
	fac.append(fac[i-1] * i % MOD)
	inv.append(MOD - inv[ MOD % i ] * (int(MOD / i)) % MOD)
	finv.append(finv[i - 1] * inv[i] % MOD)

def COM(nnn, kkk):
	if nnn < kkk:
		return 0
	
	if nnn < 0 or kkk < 0:
		return 0
	
	return fac[nnn] * (finv[kkk] * finv[nnn-kkk] % MOD) % MOD


x,y = map(int, input().split())

n = 2 * x - y
m = 2 * y - x

ans = 0
if n % 3 == 0:
	if m % 3 == 0:
		nn = int(n / 3)
		mm= int(m / 3)
		ans = COM(nn+mm,nn)

print(ans)
Buggy python submission (verdict: Runtime Error):
n=input()
v=[]
for i in range(n):
  v.append(input())
v.sort()
s=0
while(len(v)>1):
    v0=v.pop(0)
    v1=v.pop(0)
    v.append((v0+v1)/2)
    v.sort()
print(v[0])

Fixed submission:
n=int(input())
v=list(map(int, input().split()))
v.sort()
s=0
while(len(v)>1):
    v0=v.pop(0)
    v1=v.pop(0)
    v.append((v0+v1)/2)
    v.sort()
print(v[0])
Buggy python submission (verdict: Runtime Error):
inputStr = input().split()
intA = int(inputStr[0])
intB = int(inputStr[1])
intX = int(inputStr[2])

intN = 0
sum = 0

while(sum < intX):
  sum = intA * intN + intB * len(str(intN))
  intN+=1

print(intN - 2)

Fixed submission:
str = input()
if str == 'SUN':
  print(7)
elif str == 'MON':
  print(6)
elif str == 'TUE':
  print(5)
elif str == 'WED':
  print(4)
elif str == 'THU':
  print(3)
elif str == 'FRI' :
  print(2)
elif str == 'SAT':
  print(1)
Buggy python submission (verdict: Runtime Error):
in = [input() for i in range(2)]
num = str(in[0])
strCodePoint = ord(in[1])
sum = num + strCodePoint
if sum > 65 + 26 :
  print(char(sum - 26))
else:
  print(char(sum))


Fixed submission:
def changeStr(num, charactor):
  sum = num + ord(charactor)
  if sum > 64 + 26 :
    return chr(sum - 26)
  else:
    return chr(sum)

inputStr = [input() for i in range(2)]
num = int(inputStr[0])
targetStr = inputStr[1]

for target in list(targetStr):
  print(changeStr(num, target), end="")
Buggy python submission (verdict: Runtime Error):
mapping = {
  "SUN": 0,
  "MON": 1,
  "TUE": 2,
  "WED": 3,
  "THU": 4,
  "FRI": 5,
  "SAT": 6,
}


S = input()
return 7-mapping[S]




Fixed submission:
def main():
  mapping = {
    "SUN": 0,
    "MON": 1,
    "TUE": 2,
    "WED": 3,
    "THU": 4,
    "FRI": 5,
    "SAT": 6,
  }
 
 
  S = input()
  print(7-mapping[S])
 
if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
S = ['Sunny', 'Cloudy', 'Rainy']
today = input('S')

if today == 'Sunny':
  num = 0
elif today == 'Cloudy':
  num = 1
elif today == 'Rainy':
  num = 2

print(S[num + 1])

Fixed submission:
weather_list = ['Sunny', 'Cloudy', 'Rainy']

today = input()

if today == 'Sunny':
  num = 1
elif today == 'Cloudy':
  num = 2
elif today == 'Rainy':
  num = 0

print(weather_list[num])
Buggy python submission (verdict: Runtime Error):
a = input().split()
x = int(a[0])
y = int(a[1])
def h(x,y):
    d = {1:300000,2:200000,1:100000}
    if x==1 and y ==1:
        return 1000000
    print(d.get(x)+y.get(y))
h(x,y)

Fixed submission:
a = input().split()
#print(a)
x = a[0]
y = a[1]
def h(x,y):
    d = dict()
    d = {'1':300000,'2':200000,'3':100000}
    if x=='1' and y =='1':
        print(1000000)
        return
    res = 0
    res = d.get(x,0) + d.get(y,0)
    print(int(res))
h(x,y)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
for i in A:
    i = int(i)

def h(n,A):
    res = float('inf')
    for i in range(len(A)):
        temp1 = sum(A[:i])
        temp2 = sum(A[i:])
        res = min(res,abs(temp1-temp2))
    print(res)
h(n,A)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
for i in A:
    i = int(i)

def h(n,A):
    res = float('inf')
    f = []
    b = []
    t = 0
    for i in range(len(A)):
        t+=A[i]
        f.append(t)
    t = 0
    for i in range(len(A)-1,-1,-1):
        t += A[i]
        b.append(t)
    b.reverse()
    for i in range(len(A)-1):
        temp1 = f[i]
        temp2 = b[i+1]
        res = min(res,abs(temp1-temp2))
        
    #print(f)
    #print(b)
    print(res)
    
    
    
h(n,A)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
s = 1
c = 0
while s<b:
    s += a - 1
    c += 1
print(c)

Fixed submission:
cnm = input().split()
a = int(cnm[0])
b = int(cnm[1])
s = 1
c = 0
while s<b:
    s += a - 1
    c += 1
print(c)