Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
X,Y=map(str, input().split())
str_list = 'abcdef'
x=str_list.index(X)
y=str_list.index(Y)
if x<y : print('<')
if x==y: print('=')
if x>y : print('>')

Fixed submission:
X,Y=map(str, input().split())
str_list = 'ABCDEF'
x=str_list.index(X)
y=str_list.index(Y)
if x<y : print('<')
if x==y: print('=')
if x>y : print('>')
Buggy python submission (verdict: Runtime Error):
S1=int(input())
S2=int(input())
if S1 == S2[2]+S2[1]+S2[0]:
  print('YES')
else:
  print('NO')

Fixed submission:
S1=str(input())
S2=str(input())
if S1 == S2[2]+S2[1]+S2[0]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
print(Nn**2-a)

Fixed submission:
n=int(input())
a=int(input())
print(n**2-a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
num = 0
for i in range(N):
  a,b=map(int, input().split())
  num = num + b - a + 1
print(num)

Fixed submission:
n=int(input())
num = 0
for i in range(n):
  a,b=map(int, input().split())
  num = num + b - a + 1
print(num)
Buggy python submission (verdict: Runtime Error):
if X<t:
  print(0)
else:
  print(X-t)

Fixed submission:
X,t=map(int, input().split())
if X<t:
  print(0)
else:
  print(X-t)
Buggy python submission (verdict: Runtime Error):
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  print(a_list[c_list.index(0)])

Fixed submission:
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  c_list = c_list.tolist()
  print(a_list[c_list.index(0)])

Buggy python submission (verdict: Runtime Error):
S=str(input())
list_ = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(S)):
  if len([1 for s in list_ if s==S[i]])>0:
    n=list_.index(S[i])
    list_ = list_[:n] + list_[n + 1:]
print(list_[0])

Fixed submission:
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  c_list = c_list.tolist()
  print(a_list[c_list.index(0)])

Buggy python submission (verdict: Runtime Error):
S=str(input())
list_ = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(S)):
  if len([1 for s in list_ if s==S[i]]>0):
    n=list_.index(S[i])
    list_ = list_[:n] + list_[n + 1:]
print(list_[0])

Fixed submission:
import numpy as np
S=input()
a_list = "abcdefghijklmnopqrstuvwxyz"
c_list = np.zeros(26)

for i in range(len(S)):
  c_list[a_list.index(S[i])] = c_list[a_list.index(S[i])] + 1

if not 0 in c_list: print('None')
else:
  c_list = c_list.tolist()
  print(a_list[c_list.index(0)])
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
print((a-1)*(B-1))

Fixed submission:
a,b=map(int, input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split())
L=list(map(int, input().split()))
L.sort(reverse=True)
print(sum(L[0,K]))

Fixed submission:
N,K=map(int, input().split())
L=list(map(int, input().split()))
L.sort(reverse=True)
print(sum(L[0:K]))
Buggy python submission (verdict: Runtime Error):
S=str(input())
for i in range(len(S)):
  s = S[0:len(S)-i]
  if len(s)%2 == 0:
    if s[0:len(s)/2] == s[len(s)/2:len(s)]:
      break
print(len(s))

Fixed submission:
S=str(input())
for i in range(1,len(S)):
  s = S[0:len(S)-i]
  if len(s)%2 == 0:
    if s[0:round(len(s)/2)] == s[round(len(s)/2):len(s)]:
      break
print(len(s))
Buggy python submission (verdict: Runtime Error):
X,A,B=map(int, input().split())
if A>=B:
  print('delicious')
elif A+X>=N:
  print('safe')
else:
  print('dangerous')

Fixed submission:
X,A,B=map(int, input().split())
if A>=B:
  print('delicious')
elif A+X>=B:
  print('safe')
else:
  print('dangerous')
Buggy python submission (verdict: Runtime Error):
N=int(input())
A = []
for i in range(N):
  Ai=int(input())
  A.append(Ai)
on = 1
for i in range(N):
  on = A[on]
  if on == 2:
    print(i)
    break
if i != 2:
  print(-1)

Fixed submission:
N=int(input())
A = []
for i in range(N):
  Ai=int(input())
  A.append(Ai)
on = 1 #現実世界での番号
for i in range(N):
  on = A[on-1] #次のボタンを知るために、配列を参照する
  if on == 2:
    print(i+1)
    break
if on != 2:
  print(-1)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(str, input().split())
if a[len(a)]==b[0] and b[len(b)]==c[0]:
  print('YES')
else:
  print('NO')

Fixed submission:
a,b,c=map(str, input().split())
if a[len(a)-1]==b[0] and b[len(b)-1]==c[0]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
O=str(input())
E=str(input())
S=""
if len(O)==len(E):
  for i in range(len(O)):
    S=S+O[i]+E[i]
else:
  for i in range(len(O)-1):
    S=S+O[i]+E[i]
  S=S+O[len(O)]
print(S)

Fixed submission:
O=str(input())
E=str(input())
S=""
if len(O)==len(E):
  for i in range(len(O)):
    S=S+O[i]+E[i]
else:
  for i in range(len(O)-1):
    S=S+O[i]+E[i]
  S=S+O[len(O)-1]
print(S)
Buggy python submission (verdict: Runtime Error):
def distance(a,b,c,d):
  return abs(a-c)+abs(b-d)

N,M=map(int, input().split())
Alist = []
Blist = []
for i in range(N):
  a,b=map(int, input().split())
  Alist.append(a)
  Blist.append(b)
Clist = []
Dlist = []
for i in range(M):
  c,d=map(int, input().split())
  Clist.append(c)
  Dlist.append(d)

for i in range(N):
  min_d = 10*10
  a = Alist[i]
  for k in range(M):
    b = Blist[k]
    if min_d > distance(a[0],a[1],b[0],b[1]):
      min_d = distance(a[0],a[1],b[0],b[1])
      kiroku = k
  print(k)


Fixed submission:
def distance(a,b,c,d):
  return abs(a-c)+abs(b-d)

N,M=map(int, input().split())
Alist = []
Blist = []
for i in range(N):
  a,b=map(int, input().split())
  Alist.append(a)
  Blist.append(b)
Clist = []
Dlist = []
for i in range(M):
  c,d=map(int, input().split())
  Clist.append(c)
  Dlist.append(d)

for i in range(N):
  min_d = 10**10
  a = Alist[i]
  b = Blist[i]
  for k in range(M):
    c = Clist[k]
    d = Dlist[k]
    if min_d > distance(a,b,c,d):
      min_d = distance(a,b,c,d)
      kiroku = k
#    print(a,b,c,d,distance(a,b,c,d),min_d)
  print(kiroku+1)
Buggy python submission (verdict: Runtime Error):
S=str(input())
print(S[0:5]+' '+S[6:13]+' 'S[14:19])

Fixed submission:
S=str(input())
print(S[0:5]+' '+S[6:13]+' '+S[14:19])
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int, input().split())
count = 0
for x in range(min([K+1,S+1])):
  for y in range(min([K+1,S+1-x])):
    for z in range(min([K+1,S+1-x-y])):
      if x+y+z == S:
        count = count + 1
print(count)


Fixed submission:
K,S=map(int, input().split())
count = 0
for x in range(min([K+1,S+1])):
  for y in range(min([K+1,S+1-x])):
    if S-x-y<=K:
      count = count + 1
print(count)

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

Fixed submission:
K,S=map(int, input().split())
count = 0
for x in range(min([K+1,S+1])):
  for y in range(min([K+1,S+1-x])):
    if S-x-y<=K:
      count = count + 1
print(count)

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

Fixed submission:
K,S=map(int, input().split())
count = 0
for x in range(min([K+1,S+1])):
  for y in range(min([K+1,S+1-x])):
    if S-x-y<=K:
      count = count + 1
print(count)
Buggy python submission (verdict: Runtime Error):
a,b,c=str(int, input().split())
if b == '+':
  print(int(a)+int(b))
else:
  print(int(a)-int(b))

Fixed submission:
a,b,c=map(str, input().split())
if b == '+':
  print((int(a)+int(c)))
else:
  print(int(a)-int(c))
Buggy python submission (verdict: Runtime Error):
N=int(input())
T=list(map(int, input().split()))
M=int(input())
for i in range(M):
  P,X=map(int, input().split())
  print(sum(T)-(T[P]-X))

Fixed submission:
N=int(input())
T=list(map(int, input().split()))
M=int(input())
for i in range(M):
  P,X=map(int, input().split())
  print(sum(T)-T[P-1]+X)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(long, input().split())
print(math.floor(b/x)-math.ceil(a/x)+1)


Fixed submission:
a,b,x=map(int, input().split())
print(b//x-((a-1)//x+1)+1)
Buggy python submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = str(input())

turn = "A"
while True:
  if turn == "A":
    turn = A[0].upper()
    if len(A) == 0:
      print(A.upper())
      break
    A = A[1:len(A)]
  elif turn == "B":
    turn = B[0].upper()
    if len(B) == 0:
      print(B.upper())
      break
    B = B[1:len(B)]
  else:
    turn = C[0].upper()
    if len(C) == 0:
      print(C.upper())
      break
    C = C[1:len(C)]

Fixed submission:
A = str(input())
B = str(input())
C = str(input())

turn = "A"
while True:
  if turn == "A":
    if len(A) == 0:
      print(turn)
      break
    turn = A[0].upper()
    A = A[1:len(A)]
  elif turn == "B":
    if len(B) == 0:
      print(turn)
      break
    turn = B[0].upper()
    B = B[1:len(B)]
  else:
    if len(C) == 0:
      print(turn)
      break
    turn = C[0].upper()
    C = C[1:len(C)]

Buggy python submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = str(input())

turn = "A"
while True:
  if turn = "A":
    turn = A[0].upper()
    if len(A) == 1:
      print(A)
      break
    A = A[1:len(A)]
  if turn = "B":
    turn = B[0].upper()
    if len(B) == 1:
      print(B)
      break
    B = B[1:len(B)]
  if turn = "C":
    turn = C[0].upper()
    if len(C) == 1:
      print(C)
      break
    C = C[1:len(C)]

Fixed submission:
A = str(input())
B = str(input())
C = str(input())

turn = "A"
while True:
  if turn == "A":
    if len(A) == 0:
      print(turn)
      break
    turn = A[0].upper()
    A = A[1:len(A)]
  elif turn == "B":
    if len(B) == 0:
      print(turn)
      break
    turn = B[0].upper()
    B = B[1:len(B)]
  else:
    if len(C) == 0:
      print(turn)
      break
    turn = C[0].upper()
    C = C[1:len(C)]
Buggy python submission (verdict: Runtime Error):
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
n_list = []
for i in range(26):
  n_list.append(0)
for i in range(len(S)):
  n_list.index(S[i]) = n_list.index(S[i]) + 1
num = 1
for i in range(26):
  num = num * (n_list[i]+1)
if num % 2 == 1:
  print('Yes')
else:
  print('No')

Fixed submission:
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
n_list = []
for i in range(26):
  n_list.append(0)
for i in range(len(S)):
  n_list[s_list.index(S[i])] = n_list[s_list.index(S[i])] + 1
num = 1
for i in range(26):
  num = num * (n_list[i]+1)
if num % 2 == 1:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

n = int(input())

an = list(map(int, input().split()))

if min(an) == 0:
    print(0)
else:
    calc = reduce(mul, an)
    if calc >10 ** 18:
        print(-1)
    else:
        print(calc)

Fixed submission:
n = int(input())

an = list(map(int, input().split()))

if min(an) == 0:
    print(0)
else:
    calc = 1
    is_ok = True
    for i in sorted(an, reverse=True):
        calc *= i
        if calc >10 ** 18:
            is_ok = False
            break
    if is_ok:
        print(calc)        
    else:
        print(-1)
Buggy python submission (verdict: Runtime Error):
s = input()

count = 0
if  len(s) < 4:
    print(0)
else:
    for i in range(len(s) -4 + 1):
        for j in range(len(s) - 4 + 1 - i):
#             print(i, j + 4, s[i : j + 4 + i])
            if int(s[i : j + 4 + i]) % 2019 == 0:
                count+=1
#                 print(s[i : j + 4 + i])
    print(count)

Fixed submission:
s, w = map(int, input().split())

if s <= w:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)
  
k = int(input())

sum_of_gcd = 0
for a in range(k):
    for b in range(k):
        for c in range(k):
            sum_of_gcd  += gcd((a + 1), (b + 1), (c +1))
print(sum_of_gcd)

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k = int(input())

sum_of_gcd = 0
dict_of_gcd = {}
for a in range(k):
    for b in range(k):
        for c in range(k):
            if a == b == c:
                sum_of_gcd  += a + 1
            else:
                sum_of_gcd  += gcd((a + 1), (b + 1), (c +1))
print(sum_of_gcd)
Buggy python submission (verdict: Runtime Error):
k, n = map(int, input().split())

An = list(map(int, input().split()))

node = [An[i+1] - An[i]  for i in range(len(An) - 1)]

node = node[:] + [k - An[n-1] + An[0]]

print(k - max(node))

Fixed submission:
S = input()
if (S[2] == S[3]) and (S[4] == S[5]):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
k, n = map(int, input().split())
 
An = list(map(int, input().split()))
 
mn = 0
Amax = max(An)
Amin = min(An)
for i in range(len(An)):
    cal = 0
    A = An[i:]  + An[:i]
    for i in range(len(A)-1):
        if A[i] == Amax and A[i+1] == Amin:
            cal += A[i+1] + k - A[i]
        elif A[i] == Amin and A[i+1] == Amax:
            cal += A[i] + k - A[i+1]
        elif A[i+1] >= A[i]:
            cal += A[i+1] - A[i]
        else:
            cal += A[i] - A[i+1]
        
        if mn > 0 and cal > mn:
            break
    
    if mn ==0 or mn > cal:
        mn = cal
        
rAn = An[:]
rAn.reverse()
for i in range(len(rAn)):
    cal = 0
    A = rAn[i:]  + rAn[:i]
    for i in range(len(A)-1):
        if A[i] == Amax and A[i+1] == Amin:
            cal += A[i+1] + k - A[i]
        elif A[i] == Amin and A[i+1] == Amax:
            cal += A[i] + k - A[i+1]
        elif A[i+1] >= A[i]:
            cal += A[i+1] - A[i]
        else:
            cal += A[i] - A[i+1]
            
        if mn > 0 and cal > mn:
            break
 
    if mn ==0 or mn > cal:
        mn = cal
print(mn)



Fixed submission:
S = input()
if (S[2] == S[3]) and (S[4] == S[5]):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b >= c:
    print('No')
elif a**0.5+b**0.5-c**0.5 < 1e-50:
    print('Yes')
else:
    print('No')

Fixed submission:
dataset = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
k = int(input())
print(dataset[k-1])

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b >= c:
    print('No')
elif a**0.5+b**0.5-c**0.5 < 1e-30:
    print('Yes')
else:
    print('No')

Fixed submission:
dataset = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
k = int(input())
print(dataset[k-1])

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b >= c:
    print('No')
elif a**0.5+b**0.5-c**0.5 < 1e-100:
    print('Yes')
else:
    print('No')

Fixed submission:
dataset = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
k = int(input())
print(dataset[k-1])
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())

n_div_ab = n // (a+b)
n_mod_ab = n % (a+b)
if a == 0:
    res = 0
if n_mod_ab // a > 0:
    res = n_mod_ab // a * a
else:
    res = n_mod_ab
print(n_div_ab * a + res)

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

n_div_ab = n // (a+b)
n_mod_ab = n % (a+b)
if a == 0:
    res = 0
elif n_mod_ab // a > 0:
    res = a
else:
    res = n_mod_ab

print(n_div_ab * a + res)

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

n_div_ab = n // (a+b)
n_mod_ab = n % (a+b)
if n_mod_ab // a > 0:
    res = n_mod_ab // a * a
else:
    res = n_mod_ab
print(n_div_ab * a + res)

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

n_div_ab = n // (a+b)
n_mod_ab = n % (a+b)
if a == 0:
    res = 0
elif n_mod_ab // a > 0:
    res = a
else:
    res = n_mod_ab

print(n_div_ab * a + res)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

a_tax = int(a / 0.08)
b_tax = int(b / 0.1)
n  = min([a_tax, b_tax])

while True:
    if a == int(n * 0.08) and b == int(n * 0.1):
        break
    
    n += 1

print(n)

Fixed submission:
a, b = map(int, input().split())
for i in range(2000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        break
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        xy.append(list(map(int, input().split())))
    
    XY.append(xy)
    
def check(i, xiyj, HoU):
    # 矛盾したらFalse 正直者と仮定した証言より 正直&正直者と仮定されている / 不親切&不親切と仮定されている True
    if ((i >> xiyj) & 1) ^ HoU:
        return False

    return True
    
max_honest = 0
for i in range(2 ** len(XY)):
    count = 0
    honest = [0] * len(XY)
    is_contradiction = True
    for j in range(len(XY)):
        # 正直者と仮定したときだけ採用
        if not ((i >> j) & 1): continue
        for k in range(len(XY[j])):
            xiyj = XY[j][k][0] - 1
            HoU = XY[j][k][1]
            
            if not check(i, xiyj, HoU):
                is_contradiction = False

    if is_contradiction:
        for j in range(len(XY)):
            if ((i >> j) & 1): count+=1 
                
        if count > max_honest:
            max_honest =count
            
print(max_honest)

Fixed submission:
n = int(input())
 
XY = []
for i in range(n):
    a = int(input())
    xy = []
    for j in range(a):
        xy.append(list(map(int, input().split())))
    
    XY.append(xy)
    
def check(i, xiyj, HoU):
    # 矛盾したらFalse 正直者と仮定した証言より 正直&正直者と仮定されている / 不親切&不親切と仮定されている True
    if ((i >> xiyj) & 1) ^ HoU:
        return False
 
    return True
    
max_honest = 0
for i in range(2 ** len(XY)):
    count = 0
    honest = [0] * len(XY)
    is_contradiction = True
    for j in range(len(XY)):
        # 正直者と仮定したときだけ採用
        if not ((i >> j) & 1): continue
        for k in range(len(XY[j])):
            xiyj = XY[j][k][0] - 1
            HoU = XY[j][k][1]
            
            if not check(i, xiyj, HoU):
                is_contradiction = False
 
    if is_contradiction:
        for j in range(len(XY)):
            if ((i >> j) & 1): count+=1 
                
        if count > max_honest:
            max_honest =count
            
print(max_honest)
Buggy python submission (verdict: Runtime Error):
N = int(input())
xy = []
for i in range(N):
    a, b = (int(x) for x in input().split())
    xy.append([a, b])
    
def distance(d, xy, i, j):
    return (
              (xy[i][0] - xy[j][0]) ** 2
            + (xy[i][1] - xy[j][1]) ** 2
        ) ** 0.5
 
import itertools
d = []
l1 = [x for x in range(N)]
for v in itertools.permutations(l1, N):
    l2 = list(v)
    d0 = []
    for c in range(N-1):
        i = l2[c]
        j = l2[c+1]
        d0.append(distance(d, xy, i, j))
    d.append(sum(d0))
 
print(sum(d) / len(d))

Fixed submission:
r = int(input())
print(r * r)
Buggy python submission (verdict: Runtime Error):
N = int(input())
kk = list(map(int, input().split()))
a = sum(kk)

if N == 1:
  print(0)
else:
  for k in range (N-1):
    if kk[N-k-2] > kk[N-k-1]:
      c = kk[N-k-1:N]
      d=kk[N-k-2]
      c_=[d if i<d else i for i in c]
      kk[N-k-1:N]=c_
  b = sum(kk)
  print(b-a)

Fixed submission:
kk = list(map(int, input().split()))
a = kk[0] - (kk[0] % kk[1])
b = a / kk[1]

if (kk[0] % kk[1]) == 0:
  answer = b * kk[2]
else:
  answer = (b + 1) * kk[2]
print(int(answer))
Buggy python submission (verdict: Runtime Error):
input_line = input()
a = input_line % 1000
if a == 0:
  print(0)
else:
  print(1000-a)

Fixed submission:
input_line = int(input())
a = input_line % 1000
if a == 0:
  print(0)
else:
  print(1000-a)
Buggy python submission (verdict: Runtime Error):
N=int(input())
AC=0
WA=0
TLE=0
RE=0
 
for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  elif K=="WA":
    WA=WA+1
  elif K=="TLE":
    TLE=TLE+1
  else:
    RE=RE+1
 
print("AC x " + AC)
print("WA x " + RE)
print("TLE x " + TLE)
print("RE x " + RE)

Fixed submission:
N=int(input())
AC=0
WA=0
TLE=0
RE=0
 
for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  if K=="WA":
    WA=WA+1
  if K=="TLE":
    TLE=TLE+1
  if K=="RE":
    RE=RE+1
 
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))

Buggy python submission (verdict: Runtime Error):
N=int(input())
AC=0
WA=0
TLE=0
RE=0

for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  if K=="WA":
    WA=WA+1
  if K=="TLE":
    TLE=TLE+1
  if K=="RE":
    RE=RE+1

print("AC x " + AC)
print("WA x " + RE)
print("TLE x " + TLE)
print("RE x " + RE)

Fixed submission:
N=int(input())
AC=0
WA=0
TLE=0
RE=0
 
for k in range(N):
  K=input()
  if K=="AC":
    AC=AC+1
  if K=="WA":
    WA=WA+1
  if K=="TLE":
    TLE=TLE+1
  if K=="RE":
    RE=RE+1
 
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split(' ')))

Asum=0
for i in range(N):
  for j in range(i):
    Asum+=(A[i]*A[j])%(10**9+7)
    Asum%=10**9+7

print(Asum)

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

AjtoN=sum(A)
Asum=0
for i in range(N):
    AjtoN-=A[i]
    Asum+=A[i]*AjtoN
    Asum=Asum%(10**9+7)

print(Asum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split(' ')))

Asum=0
for i in range(N):
  for j in range(i):
    Asum+=A[i]*A[j]
    Asum%=10**9+7

print(Asum)

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

AjtoN=sum(A)
Asum=0
for i in range(N):
    AjtoN-=A[i]
    Asum+=A[i]*AjtoN
    Asum=Asum%(10**9+7)

print(Asum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split(' ')))

Asum=0
for i in range(N):
  for j in range(i):
    Asum+=A[i]*A[j]
    Asum%=10**9+7

print(Asum)

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

AjtoN=sum(A)
Asum=0
for i in range(N):
    AjtoN-=A[i]
    Asum+=A[i]*AjtoN
    Asum=Asum%(10**9+7)

print(Asum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split(' ')))

Asum=0
for i in range(N):
    Asum+=(A[i]*sum(A[0:i]))
    Asum=Asum%(10**9+7)
print(Asum)

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

AjtoN=sum(A)
Asum=0
for i in range(N):
    AjtoN-=A[i]
    Asum+=A[i]*AjtoN
    Asum=Asum%(10**9+7)

print(Asum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split(' ')))

Asum=0
for i in range(N):
    Asum+=A[i]*sum(A[0:i])

print(Asum%(10**9+7))

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

AjtoN=sum(A)
Asum=0
for i in range(N):
    AjtoN-=A[i]
    Asum+=A[i]*AjtoN
    Asum=Asum%(10**9+7)

print(Asum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split(' ')))

Asum=0
for i in range(N):
  for j in range(i):
    Asum+=A[i]*A[j]

print(Asum%(10**9+7))

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

AjtoN=sum(A)
Asum=0
for i in range(N):
    AjtoN-=A[i]
    Asum+=A[i]*AjtoN
    Asum=Asum%(10**9+7)

print(Asum)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split(' ')))

Asum=0
for i in range(N):
  for j in range(i):
    Asum+=A[i]*A[j]

print(Asum%(10**9+7))

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

AjtoN=sum(A)
Asum=0
for i in range(N):
    AjtoN-=A[i]
    Asum+=A[i]*AjtoN
    Asum=Asum%(10**9+7)

print(Asum)