Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
     
n, D = map(int, input().split())
point = []
for _ in range(n):
	x = list(map(int, input().split()))
    point.append(x)
     
cnt = 0
for i in range(n-1):
	for j in range(i+1, n):
		dist = 0
        for d in range(D):
        	dist += (point[i][d] - point[j][d])**2
     
        dist = math.sqrt(dist)
        if int(dist) == dist:
        	cnt += 1
     
print(cnt)

Fixed submission:
import math
     
n, D = map(int, input().split())
     
point = []
for _ in range(n):
	x = list(map(int, input().split()))
	point.append(x)
     
cnt = 0
for i in range(n-1):
	for j in range(i+1, n):
		dist = 0
		for d in range(D):
			dist += (point[i][d] - point[j][d])**2
     
		dist = math.sqrt(dist)
		if int(dist) == dist:
			cnt += 1
     
print(cnt)
Buggy python submission (verdict: Runtime Error):
N, L = map(int,input().split())

ans == 0
for i in range(1,n+1):
  p = list[L+i-1]
  ans += p[i]

print(ans)

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

total = N*(2*L+N-1)//2

if L>=0:
	small = L
elif L<0 and L+N-1>=0:
	small = 0
else:
	small = L+N-1
print(total - small)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()

print(s.replace('s[k-1]', ''s[k-1]'.lower()')

Fixed submission:
N,K = map(int,input().split())
s = list(input())
s[K-1] = s[K-1].lower()
     
print("".join(s))
Buggy python submission (verdict: Runtime Error):
n, m ,c = map(int,input().split())
b = list(map(int,input().split()))

for i in range(n):
	a = list(map(int,input().split()))
    
x=0

for i in range(n):
	if ((sum(a[i]*b[i] for j in range(m)) + c)>0):
		x+=1
print(x)

Fixed submission:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
ans=0
for _ in range(n):
	a=list(map(int,input().split()))
	if sum(a[i]*b[i] for i in range(m))+c>0: ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
s = int(input())
c = 0
a = [s]
while c < 100000:
  if s % 2 == 0:
    s = s//2
    c += 1
  else:
    s = 3*s+1
    c += 1
    a += [s]
  for i in range(c):
    if a[i] in a[:i]:
      print(i+1)
      exit()

Fixed submission:
s = int(input())
a = []
while s not in a:
  a.append(s)
  if s%2 == 0:
    s = s/2
  else:
    s = 3*s+1
print(len(a)+1)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print('Hellow World' if a == 1 else b + c)

Fixed submission:
N = int(input())
if N == 1:
	print("Hello World")
else:
	A = int(input())
	B = int(input())
	print(A+B)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print('Hellow World' if a == 1 else b + c)

Fixed submission:
N = int(input())
if N == 1:
	print("Hello World")
else:
	A = int(input())
	B = int(input())
	print(A+B)
Buggy python submission (verdict: Runtime Error):
n, T = map(int,input().split())
A=[]
for i in range(n):
  a = list(map(int,input().split()))
  if a[1]<=T:
    A.append(a[0])

if len(a)==0:
  print('TLE')
else:
  print(min(A))

Fixed submission:
n,t=map(int, input().split())
A=[]
for i in range(n):
  a=list(map(int, input().split()))
  if a[1] <= t:
    A.append(a[0])
if len(A)==0:
  print('TLE')
else:
  print(min(A))

Buggy python submission (verdict: Runtime Error):
n, T = map(int,input().split())
A=[]
for i in range(n):
  a = list(map(int,input().split()))
  if a[1]<=T:
    A.append(a[0])

if len(a)==0:
    print('TLE')
else:
    print(min(A))

Fixed submission:
n,t=map(int, input().split())
A=[]
for i in range(n):
  a=list(map(int, input().split()))
  if a[1] <= t:
    A.append(a[0])
if len(A)==0:
  print('TLE')
else:
  print(min(A))

Buggy python submission (verdict: Runtime Error):
n, T = map(int,input().split())
A=[]
for i in range(n):
  a = list(map(int,input().split()))
  if a[1]<=T:
    A.append(a[0])

if len(a)==0:
    print('TLE')
else:
    print(min(A))

Fixed submission:
n,t=map(int, input().split())
A=[]
for i in range(n):
  a=list(map(int, input().split()))
  if a[1] <= t:
    A.append(a[0])
if len(A)==0:
  print('TLE')
else:
  print(min(A))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input()split())

s = sorted.[a, b, c]

print(s)

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

print(a + b + 10*c)
Buggy python submission (verdict: Runtime Error):
    h, w = map(int, input().split())
    a = []
    for _ in range(h):
        l = input()
        if l != '.'*w:
            a.append(l)
    col = []
    h = len(a)
    for i in range(w):
        if a[0][i] == '.':
            for j in range(1,h):
                if a[j][i] != '.':
                    col.append(i)
                    break
        else:
            col.append(i)
    for l in a:
        ll = ''
        for i in col:
            ll += l[i]
        print(ll)

h, w = map(int, input().split())
a = []
for _ in range(h):
    l = input()
    if l != '.'*w:
        a.append(l)
col = []
h = len(a)
for i in range(w):
    if a[0][i] == '.':
        for j in range(1,h):
            if a[j][i] != '.':
                col.append(i)
                break
    else:
        col.append(i)
for l in a:
    ll = ''
    for i in col:
        ll += l[i]
    print(ll)

Fixed submission:
h, w = map(int, input().split())
a = []
for _ in range(h):
    l = input()
    if l != '.'*w:
        a.append(l)
col = []
h = len(a)
for i in range(w):
    if a[0][i] == '.':
        for j in range(1,h):
            if a[j][i] != '.':
                col.append(i)
                break
    else:
        col.append(i)
for l in a:
    ll = ''
    for i in col:
        ll += l[i]
    print(ll)
Buggy python submission (verdict: Runtime Error):
a=list(input())
k=int(input())
if a[0]=="1":
  print(a[1])
else:
  print(a[0])


Fixed submission:
s=input()
k=int(input())
for i in range(k):
  if s[i]!="1":
    break
print(s[i])

Buggy python submission (verdict: Runtime Error):
b=list(input())
a=int(input())
if b[0]=="1":
  print(b[1])
else:
  print(b[0])


Fixed submission:
s=input()
k=int(input())
for i in range(k):
  if s[i]!="1":
    break
print(s[i])

Buggy python submission (verdict: Runtime Error):
b=list(input())
a=int(input())
if b[0]=="1":
  print(1)
else:
  print(b[1])


Fixed submission:
s=input()
k=int(input())
for i in range(k):
  if s[i]!="1":
    break
print(s[i])
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

print(max([a+b, a-b, a*b]))

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

print(max([a+b, a-b, a*b]))
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int,input().split())

Answer = set([])
for i in range(K):
    if A+i <=B:
        Answer.add(A+i)
    if B - i >= A:
        Answer.add(B-i)
Answer = sorted(Answer)
for i in Answer:
    print(i)

Fixed submission:
A, B, K = map(int, input().split())
a = [i for i in range(A, min(A+K,B))]
b = [i for i in range(max(A,B-K+1), B+1)]
for x in sorted(list(set(a + b))):
  print(x)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

ans = 0
for i in s:
  ans=max(ans, s.count(i)- t.count(i))
print(ans)

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

print('Yes' if a+b >= c else 'No')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input(). split())
if (a*b) % 2:
print ("Odd")
else: print("Even")

Fixed submission:
a, b = map(int, input(). split())
if (a*b) % 2:
  print("Odd")
else: 
  print("Even")
Buggy python submission (verdict: Runtime Error):
print(input(), count("1"))

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

Buggy python submission (verdict: Runtime Error):
print(imput().count"1")

Fixed submission:
print(input().count("1"))
Buggy python submission (verdict: Runtime Error):
a = input()
x = 0
for i in range(len(N)):
    x += int(N[i])
print("Yes" if int(a) % x == 0 else "No")

Fixed submission:
a = input()
x = 0
for i in range(len(a)):
    x += int(a[i])
print("Yes" if int(a) % x == 0 else "No")
Buggy python submission (verdict: Runtime Error):
    s=input()
    t=input()
    print("YES" if s==t[::-1] else "NO")

Fixed submission:
s=input()
t=input()
print("YES" if s==t[::-1] else "NO")
Buggy python submission (verdict: Runtime Error):
a,b,c = input()

print(a if b==c else b if a==c else c)

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

print(a if b==c else b if a==c else c)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
x=[]
if n>=3:
  for i in range(1,n-1):
    x.append(a.count(i)+a.count(i-1)+a.count(i+1))
  print(max(x))
elif n==1:
    print(1)
elif n ==2:
  if abs(a[0]-a[1])<=1:
    print(2)
  else:
    print(1)
    

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
z = 100002*[0]

for a in A:
  z[a]+=1
  z[a+1]+=1
  z[a+2]+=1

print(max(z))
Buggy python submission (verdict: Runtime Error):
a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))==26:
  pritn('None')
else:
  for i in range(len(l)):
    if l[i] not in a:
      print(l[i])
      break

Fixed submission:
a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))==26:
  print('None')
else:
  for i in range(len(l)):
    if l[i] not in a:
      print(l[i])
      break

Buggy python submission (verdict: Runtime Error):
a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))==26:
  pritn('None')
else:
  for i in range(len(l)):
    if l[i] not in a:
      print(l[i])
      exit()

Fixed submission:
a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))==26:
  print('None')
else:
  for i in range(len(l)):
    if l[i] not in a:
      print(l[i])
      break

Buggy python submission (verdict: Runtime Error):
a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))=26:
  pritn('None')
  else:
    for i in range(len(l)):
      if l[i] not in a:
        print(l[i])
        exit()
  

Fixed submission:
a = input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if len(set(a))==26:
  print('None')
else:
  for i in range(len(l)):
    if l[i] not in a:
      print(l[i])
      break
Buggy python submission (verdict: Runtime Error):
a,b,c = input()
  
print('Yes' if a==c else ;'No') 

Fixed submission:
a,b,c = input()
  
print('Yes' if a==c else 'No')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
	if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    	print('Possible')
    else:
        print('Impossible')

Fixed submission:
a,b = map(int,input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    print('Possible')
else:
    print('Impossible')

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

print('possible' if (a+b)% ==0 else 'impossible')

Fixed submission:
a,b = map(int,input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
Buggy python submission (verdict: Runtime Error):
X,A,B = map(int,input()split())

print('delicious' if B <= A else 'safe' if B <= A+X else 'dangerous')

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

print('delicious' if B <= A else 'safe' if B <= A+X else 'dangerous')
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().spllit())
print("#"*(b+2))
for i in range(a):
  print("#"+input()+"#")
print("#"*(b+2))

Fixed submission:
a,b=map(int,input().split())
print("#"*(b+2))
for i in range(a):
  print("#"+input()+"#")
print("#"*(b+2))
Buggy python submission (verdict: Runtime Error):
A B C =input()



print('YES' if A[count(A-1)]==B[0] and B[count(B-1)]==c[0] else 'No')

Fixed submission:
A,B,C = input().split()
print("YES" if A[-1]==B[0] and B[-1] == C[0] else "NO")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())

print('YES' if b−a==c−b else 'NO')

Fixed submission:
a,b,c = map(int,input().split())
print("YES" if b-a==c-b else "NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans=1
for i in range(1,n+1):
  ans*=i
print(ans%(10**9+7))

Fixed submission:
n = int(input())
ans=1
for i in range(1,n+1):
  ans*=i
  ans=ans%(10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a == 1:
    a = 14
if b == 1:
    b = 14

print('Draw' if a=b elif 'Alice' a>b else 'Bob') 

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

if a == 1:
    a = 14
if b == 1:
    b = 14


print('Draw' if a==b else 'Alice' if a>b else 'Bob')
Buggy python submission (verdict: Runtime Error):
s = input(AtCoder s Contest)
print('A' + input()[8] + 'C')

Fixed submission:
print("A"+input()[8]+"C")
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int,input().split())
ans = 0  
for i in range(a, b+1):
  if i%x==0:
    ans+=1
print(ans)
 

Fixed submission:
a, b, x = map(int,input().split())
print((b//x) - ((a-1)//x))
Buggy python submission (verdict: Runtime Error):
s = input()
s = input()
ans =''
for i in range(len(s)):
  if i ==1:
    ans+='1'
  elif i==0:
    ans+='0'
  elif i=='B':
      ans = ans[:-1]
print(ans)

Fixed submission:
s = input()
ans =''
for i in s:
  if i =='1':
    ans+='1'
  elif i=='0':
    ans+='0'
  elif i=='B':
      ans = ans[:-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
def kai():
    N=int(input())
    A=list(map(int,input().split()))
    
    if  0 in A:
        print(0)
        return
    
    ans=1
    for i in A:
        ans*=i
        if ans>10**18:
            print(-1)
            return
    print(ans)
    return
kai()

Fixed submission:
A,B=map(int,input().split())
print(A*B)

Buggy python submission (verdict: Runtime Error):
def kai():
    N=int(input())
    A=list(map(int,input().split()))
    
    if  0 in A:
        print(0)
        return
    
    ans=1
    for i in A:
        ans*=i
        if ans>10**18:
            print(-1)
            rerurn
    print(ans)
    return
kai()

Fixed submission:
A,B=map(int,input().split())
print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=1
A=list(map(int,input().split()))
A.sort()
while ans<=10**18:
    for i in A:
        ans*=i
    break
if ans>10**18:
    print(-1)
else:
    print(ans)

   

Fixed submission:
def kai():
    N=int(input())
    A=list(map(int,input().split()))
    
    if  0 in A:
        print(0)
        return
    
    ans=1
    for i in A:
        ans*=i
        if ans>10**18:
            print(-1)
            return
    print(ans)
    return
kai()

Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=1
A=list(map(int,input().split()))
while ans<10**18:
    for i in A:
        ans*=i
if ans>=10**18
    print(-1)
else:
    print(ans)

Fixed submission:
def kai():
    N=int(input())
    A=list(map(int,input().split()))
    
    if  0 in A:
        print(0)
        return
    
    ans=1
    for i in A:
        ans*=i
        if ans>10**18:
            print(-1)
            return
    print(ans)
    return
kai()

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=1
A=list(map(int,input().split()))
for i in A:
  ans*=i
if ans>1000000000000000000:
  print(-1)
else:
  print(ans)

Fixed submission:
def kai():
    N=int(input())
    A=list(map(int,input().split()))
    
    if  0 in A:
        print(0)
        return
    
    ans=1
    for i in A:
        ans*=i
        if ans>10**18:
            print(-1)
            return
    print(ans)
    return
kai()

Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=1
for i in range(N):
  A=int(input())
  ans*=A
if ans>1000000000000000000:
  print(-1)
else:
  print(ans)

Fixed submission:
def kai():
    N=int(input())
    A=list(map(int,input().split()))
    
    if  0 in A:
        print(0)
        return
    
    ans=1
    for i in A:
        ans*=i
        if ans>10**18:
            print(-1)
            return
    print(ans)
    return
kai()
Buggy python submission (verdict: Runtime Error):
K=int(input())
A,B=int(input().split())
check=False
for i in range(0,B-A):
  if (B-A-i)%K==0:
    check=True
if check==True:
  print("OK")
else:
  print("NG")
  

Fixed submission:
K=int(input())
A,B=map(int,input().split())
ans="NG"
for i in range(A,B+1):
    if  i%K==0:
        ans="OK"
print(ans)
Buggy python submission (verdict: Runtime Error):
N=input()
print(N//2+N%2)

Fixed submission:
N=int(input())
print(N//2+N%2)
Buggy python submission (verdict: Runtime Error):
A,B,C=input().split()
if A==B and B==C:
  print("No")
elif:A==B or B==C or C==A:
    print("Yes")
else:
  print("No")
  

Fixed submission:
A,B,C=input().split()
if A==B and B==C:
  print("No")
elif A==B or B==C or C==A:
    print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
  print(A-1 B)
else:
  print(A B-1)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
  print(str(A-1)+" "+str(B))
else:
  print(str(A)+" "+str(B-1))
Buggy python submission (verdict: Runtime Error):
import math
 
n=int(input())
arr=list(map(int,input().split()))
ans=1
for i in range(n):
  ans *= arr[i]
if math.log10(ans) > 18:
  print("-1")
else:
  print(ans)

Fixed submission:
import math
 
n=int(input())
arr=list(map(int,input().split()))
if 0 in arr:
  print("0")
  exit()
ans=1
for i in range(n):
  ans *= arr[i]
  if math.log10(ans) >= 18 and ans!=1000000000000000000:
    print("-1")
    exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
if a==0:
  print("0")
  exit()
ans = 0
while n>0:
  if n>=a:
    ans += a
    n -= a
  else:
    ans += n
    n = -1
  n -= b
print(ans)

Fixed submission:
n,a,b=map(int,input().split())
if a==0:
  print("0")
  exit()
tmp1 = n // (a+b)
tmp2 = n-(tmp1*(a+b))
if tmp2 >= a:
  print((tmp1*a)+a)
else:
  print((tmp1*a)+tmp2)
Buggy python submission (verdict: Runtime Error):
n = int(input())

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

count = 1

for i in a:
    count*=i

x = 10**18

if count > x:
    print(-1)
    break
else:
    print(count)

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

print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = sorted(list(map(int,input().split())))

count = 1

for i in a:
    count*=i

x = 10**18

if count > x:
    print(-1)
else:
    print(count)

Fixed submission:
n = int(input())

a = sorted(list(map(int,input().split())))

count = 1

for i in range(n):
    count*=a[i]
    if count>10**18:
        print(-1)
        break

else:
    print(count)

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

a = sorted(list(map(int,input().split())))

count = 1

for i in a:
    count*=i

x = 10**18

if count > x:
    print(-1)
    break
else:
    print(count)

Fixed submission:
n = int(input())

a = sorted(list(map(int,input().split())))

count = 1

for i in range(n):
    count*=a[i]
    if count>10**18:
        print(-1)
        break

else:
    print(count)

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

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

count = 1

for i in a:
    count*=i

x = 10**18

if count > x:
    print(-1)
    break
else:
    print(count)

Fixed submission:
n = int(input())

a = sorted(list(map(int,input().split())))

count = 1

for i in range(n):
    count*=a[i]
    if count>10**18:
        print(-1)
        break

else:
    print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

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

count = 1

for i in a:
    count*=i

x = 10**18

if count > x:
    print(-1)
else:
    print(count)

Fixed submission:
n = int(input())

a = sorted(list(map(int,input().split())))

count = 1

for i in range(n):
    count*=a[i]
    if count>10**18:
        print(-1)
        break

else:
    print(count)
Buggy python submission (verdict: Time Limit Exceeded):
A , B , C , K = map(int,input().split())
s = 0
for i in range(K):
    if A >= 1:
        s += 1
        A -= 1
    elif B >= 1:
        s += 0
        B -= 1
    elif C >= 1:
        s -= 1
        C -= 1

print(s)

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

s = 0

mn = min(A, K)
s += mn 
K -= mn

mn = min(B, K)
K -= mn

mn = min(C, K)
s -=mn
K -= mn

print(s)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = N % 10
if L == 3:
  print("bon")
#0
,
1
,
6
,
8

elif L == 0 or L == 1 or L == 6 or L == 8:
  print('pon')
else:
  print('hon')

Fixed submission:
N = int(input())
L = N % 10
if L == 3:
  print("bon")
elif L == 0 or L == 1 or L == 6 or L == 8:
  print('pon')
else:
  print('hon')
Buggy python submission (verdict: Runtime Error):
input()
A = list(map(int, input().split))
count = 0
while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  count += 1
print(count)

Fixed submission:
input()
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
happy=0
def covid(num):
  if num==0:
    return 0
  else:
    fund=num//500
    num-=fund*500
    happy+=fund*1000
    happy+=num//5*5
    return happy
print(covid(n))

Fixed submission:
n=int(input())
def covid(num):
  if num==0:
    return 0
  else:
    happy=0
    fund=num//500
    num-=fund*500
    happy+=fund*1000
    happy+=num//5*5
    return happy
print(covid(n))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
n = int(sys.stdin.readline())
a = []
for _ in range(n):
  a.append(sys.stdin.readline().strip())
c = collections.Counter(a)
print(*sorted([i[0] for i in c.items() if i[1] == max(c.values())]))

Fixed submission:
import sys
import collections
n = int(sys.stdin.readline())
a = []
for _ in range(n):
  a.append(sys.stdin.readline().strip())
c = collections.Counter(a)
maxc = max(c.values())
print(*sorted([i[0] for i in c.items() if i[1] == maxc]))
Buggy python submission (verdict: Runtime Error):
import sys
import math
a,b=map(int, sys.stdin.readline().split())
print((a*b)//math.gcd(a,b))


Fixed submission:
import sys
import fractions as fr
a,b=map(int, sys.stdin.readline().split())
ans = (a*b)//fr.gcd(a,b)
print(ans)
Buggy python submission (verdict: Runtime Error):
x=int(input())
k=360%x
j=360//x
v=k
while 360%k!=0:
    k=360%k
    v+=k
v1=360//v
print(j*v1)

Fixed submission:
def do():
    x=int(input())
    k=360%x
    j=360//x
    v=k
    if k==0:
        return j
    while 360%k!=0:
        k=360%k
        v+=k
    v1=360//v
    return j*v1
print(do())

Buggy python submission (verdict: Runtime Error):
x=int(input())
k=360%x
j=360//x
v=k
while 360%k!=0:
    k=360%k
    v+=k
print(j*(360//v))

Fixed submission:
def do():
    x=int(input())
    k=360%x
    j=360//x
    v=k
    if k==0:
        return j
    while 360%k!=0:
        k=360%k
        v+=k
    v1=360//v
    return j*v1
print(do())
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
def do():
    n=int(input())
    l=list(map(int,input().split()))
    # k=1
    v=reduce(lambda x, y: x*y, l)
    if v > 1 * 10 ** 18:
        return -1
    return v
print(do())


Fixed submission:
def do():
    n=int(input())
    l=list(map(int,input().split()))
    k=1
    if 0 in l:
        return 0
    for i in l:
        k*=i
        if k>1*10**18:
            return -1
    return k
print(do())

Buggy python submission (verdict: Time Limit Exceeded):
def do():
    n=int(input())
    l=list(map(int,input().split()))
    k=1
    for i in l:
        k*=i
    if k > 1 * 10 ** 18:
        return -1
    return k
print(do())



Fixed submission:
def do():
    n=int(input())
    l=list(map(int,input().split()))
    k=1
    if 0 in l:
        return 0
    for i in l:
        k*=i
        if k>1*10**18:
            return -1
    return k
print(do())