Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
L=[]
for i in range(1,N):
  import math
  Y=(math.floor(A*i/B))-A*(math.floor(i/B))
  L.append(Y)
print(max(L))

Fixed submission:
A, B, N = map(int, input().split())
x = min(B-1, N)
print((A*x//B)-A*(x//B))

Buggy python submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
L=[]
for i in range(1,N):
  import math
  Y=(math.floor(A*i/B))-A*(math.floor(i/B))
  L.append(Y)
print(max(L))

Fixed submission:
A, B, N = map(int, input().split())
x = min(B-1, N)
print((A*x//B)-A*(x//B))
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[input() for i in range(N)]
M=set(L)
print(len(M))

Fixed submission:
S,W=map(int,input().split())
if S<=W:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
while a or c >0:
  c=c-b
  if c<=0:
    print('Yes')
    break
  a=a-d
  if a<=0:
    print('No')
    break


Fixed submission:
S,W=map(int,input().split())
if S<=W:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=a//d
f=c//b
x=a-e*d
y=c-f*b
if x==y==0:
  if f<=e:
    print('Yes')
  else:
    print('N0')
elif x==0 and y!=0:
  if f+1<=e:
    print('Yes')
  else:
    print('No')
elif y==0 and x!=0:
  if f<=e+1:
    print('Yes')
  else:
    print('NO')
else:
  if f<=e:
    print('Yes')
  else:
    print('No')
  

Fixed submission:
S,W=map(int,input().split())
if S<=W:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=a//d
f=c//b
x=a-e*d
y=c-f*b
if x==y==0:
  if f<=e:
    print('Yes')
  else:
    print('N0')
elif x==0 and y!=0:
  if f+1<=e:
    print('YES')
  else:
    print('No')
elif y==0 and x!=0:
  if f<=e+1:
    print('Yes')
  else:
    print('NO')
else:
  if f<=e:
    print('Yes')
  else:
    print('No')
  

Fixed submission:
S,W=map(int,input().split())
if S<=W:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=a//d
f=c//b
x=a-e*d
y=c-f*b
if x==y==0:
  if f<=e:
    print('Yes')
  else:
    print('N0')
if x==0:
  if f+1<=e:
    print('YES')
  else:
    print('No')
if y==0:
  if f<=e+1:
    print('Yes')
  else:
    print('NO')
else:
  if f<=e:
    print('Yes')
  else:
    print('No')
  

Fixed submission:
S,W=map(int,input().split())
if S<=W:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input.split())
while a or c >0:
  c=c-b
  if c<=0:
    print('Yes')
    break
  a=a-d
  if a<=0:
    print('No')
    break

Fixed submission:
a,b,c,d=map(int,input().split())
e=a//d
f=c//b
x=a-e*d
y=c-f*b
if x==y==0:
  if f<=e:
    print('Yes')
  else:
    print('N0')
elif x==0 and y!=0:
  if f+1<=e:
    print('Yes')
  else:
    print('No')
elif y==0 and x!=0:
  if f<=e+1:
    print('Yes')
  else:
    print('NO')
else:
  if f<=e:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[input() for i in range(n)]
M=set(L)
print(len(M))

Fixed submission:
N=int(input())
S=[input() for i in range (N)]
L=list(S)
M=list(set(L))
j=len(M)
print(j)

Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[input() for i range(N)]
M=sorted(L)
print(len(M))

Fixed submission:
N=int(input())
S=[input() for i in range (N)]
L=list(S)
M=list(set(L))
j=len(M)
print(j)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=list(map(int,input().split()))
X=sum(L)
if N-X<0:
  print(-1)
else:
  print(N-X)

Fixed submission:
R=int(input())
print(R*2*3.14)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=list(map(int,input().split()))
X=0
for i in range(M):
  X=X+L[i]
if N-X<0:
  print(-1)
else:
  print(N-X)

Fixed submission:
R=int(input())
print(R*2*3.14)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=list(map(int,input().split()))
for i in range(M):
  X=X+L[i]
if N-X<0:
  print(-1)
else:
  print(N-X)

Fixed submission:
R=int(input())
print(R*2*3.14)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=list(map(int,input().split()))
for i in range(M):
  X=X+L[i]
if N-X<0:
  print(-1)
else:
  print(N-X)

Fixed submission:
N,M=map(int,input().split())
L=list(map(int,input().split()))
X=0
for i in range(M):
  X=X+L[i]
if N-X<0:
  print(-1)
else:
  print(N-X)

Buggy python submission (verdict: Runtime Error):
,M=map(int,input().split())
L=list(map(int,input().split()))
for i in range(M):
  X=X+L[i]
if N-X<0:
  print(-1)
else:
  print(N-X)

Fixed submission:
N,M=map(int,input().split())
L=list(map(int,input().split()))
X=0
for i in range(M):
  X=X+L[i]
if N-X<0:
  print(-1)
else:
  print(N-X)
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=n//3
b=n//5
c=n//15
A=3*a*(a+1)//2+5*b*(b+1)//2-15*c*(c+1)//2
print(n*(n+1)//2-A)

Fixed submission:
N=input()
if '7' in N:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N=input()
if '7' in  N
print('Yes')
if not '7' in N
print('No')

Fixed submission:
N=input()
if '7' in N:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
 N=input()
if 7 in N
print('Yes')
if not 7 in N
print('No')


Fixed submission:
N=input()
if '7' in N:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
if 7 in N
print('Yes')
if not 7 in N
print('No')


Fixed submission:
N=input()
if '7' in N:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
x,y.z=map(int,input().split())
print(z,x,y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)
Buggy python submission (verdict: Runtime Error):
s = input()
t = s[:(len(s)-1)/2]
u = s[(len(s)+3)/2-1:]
if s == s[::-1] and t == t[::-1] and u == u[::-1]:
  print("Yes")
else:
  print("No")


Fixed submission:
s = input()
t = s[:(len(s)-1)//2]
u = s[(len(s)+3)//2-1:]
if s == s[::-1] and t == t[::-1] and u == u[::-1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,inout().split())
N=int(input())
L=[int(input()) for i in range(N)]
if a in L and b in L and c in L:
  print('Yes')
elif d in L and e in L and  f in L:
  print('Yes')
elif g in L and h in L and  i in L:
  print('Yes')
elif a in L and d in L and  g in L:
  print('Yes')
elif b in L and e in L and  h in L:
  print('Yes')
elif c in L and f in L and  i in L:
  print('Yes')
elif a in L and e in L and  i in L:
  print('Yes')
elif c in L and e in L and  g in L:
  print('Yes')
else:
  print('No')



Fixed submission:
a,b,c=map(int,input().split())
d,e,f=map(int,input().split())
g,h,i=map(int,input().split())
N=int(input())
L=[int(input()) for i in range(N)]
if a in L and b in L and c in L:
  print('Yes')
elif d in L and e in L and  f in L:
  print('Yes')
elif g in L and h in L and  i in L:
  print('Yes')
elif a in L and d in L and  g in L:
  print('Yes')
elif b in L and e in L and  h in L:
  print('Yes')
elif c in L and f in L and  i in L:
  print('Yes')
elif a in L and e in L and  i in L:
  print('Yes')
elif c in L and e in L and  g in L:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
l=[a,b,c]
sorted(l)
if len(l)==2:
  print('Yes')
elif:
  print('No')
  


Fixed submission:
a,b,c=map(int,input().split())
l=[a,b,c]
l.sort()
if l[0]==l[1] and l[1]!=l[2]:
  print('Yes')
elif l[0]!=l[1] and l[1]==l[2]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a,b,c=mpp(int,input().split())
l=[a,b,c]
sorted(l)
if len(l)==2:
  print('Yes')
elif:
  print('No')
  

Fixed submission:
a,b,c=map(int,input().split())
l=[a,b,c]
l.sort()
if l[0]==l[1] and l[1]!=l[2]:
  print('Yes')
elif l[0]!=l[1] and l[1]==l[2]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
H,N=map(int,input().split())
L=list(map(int,input().split()))
a=sum(L)
if H>L:
  print('No')
else:
  print('Yes')
       

Fixed submission:
H,N=map(int,input().split())
L=list(map(int,input().split()))
a=sum(L)
if H>a:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a,b=input().split()
r=''
for i in range(N):
  r=r+a[i]
  r=r+b[i]
print(r)

Fixed submission:
n=int(input())
a,b=input().split()
r=''
for i in range(n):
  r=r+a[i]
  r=r+b[i]
print(r)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
L='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
  a=S[i]
  index=L.find(a)
  b=L[index+N]
  ans=ans+b
prin(ans)

Fixed submission:
N=int(input())
S=input()
L='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
  a=S[i]
  index=L.find(a)
  b=L[index+N]
  ans=ans+b
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A>2B:
  print(A-2*B)
else:
  print(0)

Fixed submission:
A,B=map(int,input().split())
if A>=2*B:
  print(A-2*B)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A>2B:
  print(A-2B)
else:
  print(0)

Fixed submission:
A,B=map(int,input().split())
if A>=2*B:
  print(A-2*B)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A>2B:
  print(A-2B)
else:
  print(0)

Fixed submission:
A,B=map(int,input().split())
if A>=2*B:
  print(A-2*B)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if b%a==0:
  print(b//a)
elif:
  print(b//a+1)

Fixed submission:
a,b=map(int,input().split())
c=a-1
count=1
while a<b:
  a=a+c
  count+=1
if b==1:
  count=0
print(count)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().spliy())
if (A+B)%2==0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')


Fixed submission:
A,B=map(int,input().split())
if (A+B)%2==0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
r=int(input())
print 3*r*r

Fixed submission:
r=int(input())
print(3*r*r)

Buggy python submission (verdict: Runtime Error):
r=int(input())
s=3r**2
print('s')

Fixed submission:
r=int(input())
print(3*r*r)

Buggy python submission (verdict: Runtime Error):
r=int(input())
S=3r**2
print(S）

Fixed submission:
r=int(input())
print(3*r*r)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(b*(t//a))

Fixed submission:
a,b,c=map(int,input().split())
print(b*(c//a))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
L[a,b,c]
L.sort()
print(L[2]*10+L[1]+L[0])


Fixed submission:
a,b,c=map(int,input().split())
L=[a,b,c]
L.sort()
print(L[2]*10+L[1]+L[0])
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().spliT())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
L=[d,e,f]
L.sort()
print(L[0]+L[1])
 
 

Fixed submission:
a,b,c=map(int,input().split())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
L=[d,e,f]
L.sort()
print(L[0]+L[1])

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().spliT())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
L=list[d,e,f]
L.sort()
print(L[0]+L[1])




Fixed submission:
a,b,c=map(int,input().split())
d=abs(a-b)
e=abs(b-c)
f=abs(c-a)
L=[d,e,f]
L.sort()
print(L[0]+L[1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
for i in range(1,2N):
  if i%2==0 and i%N==0:
    print(i)
    break

Fixed submission:
N=int(input())
if N%2==0:
  print(N)
else:
  print(2*N)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=int(input())
b=N//500
c=N-500b
if A<=c:
  print('Yes')
else:
  print('No')
  

Fixed submission:
N=int(input())
A=int(input())
b=N//500
c=N-500*b
if c<=A:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
e,f,g=input().split()
if a==g and c==e and b==f:
  print('YES')
else:
  print('NO')

Fixed submission:
a=input()
b=input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print('YES')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
e,f,g=input().split()
if a==g and c==e and b==f:
  print('YES')
else:
  print('NO')

Fixed submission:
a=input()
b=input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a,b.c=map(int,input().split())
L=[a,b,c]
L.sort()
if L[0]==L[2]:
  print(1)
elif　L[0]<L[1]<L[2]:
  print(3)
else:
  print(2)

Fixed submission:
a,b,c=map(int,input().split())
if a==b==c:
  print(1)
elif a==b or b==c or c==a:
  print(2)
else:
  print(3)

Buggy python submission (verdict: Runtime Error):
a,b.c=map(int,input().split())
L=list[a,b,c]
L.sort()
if L[0]==L[2]:
  print(1)
elif　L[0]<L[1]<L[2]:
  print(3)
else:
  print(2)

Fixed submission:
a,b,c=map(int,input().split())
if a==b==c:
  print(1)
elif a==b or b==c or c==a:
  print(2)
else:
  print(3)
Buggy python submission (verdict: Runtime Error):
    s=0
    temp=100
    while temp<x:
        s+=1
        temp=int(temp*1.01)
    print(s)


Fixed submission:
x=int(input())
s=0
temp=100
while temp<x:
    s+=1
    temp=int(temp*1.01)
print(s)
Buggy python submission (verdict: Runtime Error):
def main():
  from itertools import combinations
  x = int(input())
  ls = [0]
  if x == 1:
    print(0, -1)
    exit()
  for i in range(1, 100):
    ls.append(i**5)
    ls.append(-i**5)
  ls.sort()
  for b in ls:
    if x + b in ls:
      a = x + b  
      break
  if a < 0:
    print(-1*int(pow(-a, 0.2)), end=' ')
  else:
    print(int(pow(a, 0.2)), end=' ')
  if b < 0:
    print(-1*int(pow(-b, 0.2)), end=' ')
  else:
    print(int(pow(b, 0.2)), end=' ')
  


if __name__ == '__main__':
  main()

Fixed submission:
def main():
  from itertools import combinations
  x = int(input())
  ls = [0]
  a = 0
  b = 0
  if x == 1:
    print(0, -1)
    exit()
  for i in range(1, 200):
    ls.append(i**5)
    ls.append(-i**5)
  ls.sort()
  for b in ls:
    if x + b in ls:
      a = x + b  
      break
  if a < 0:
    print(-1*int(pow(-a, 0.2)), end=' ')
  else:
    print(int(pow(a, 0.2)), end=' ')
  if b < 0:
    print(-1*int(pow(-b, 0.2)), end=' ')
  else:
    print(int(pow(b, 0.2)), end=' ')
  


if __name__ == '__main__':
  main()

Buggy python submission (verdict: Runtime Error):
def main():
  from itertools import combinations
  x = int(input())
  ls = [0]
  if x == 1:
    print(0, -1)
  for i in range(1, 100):
    ls.append(i**5)
    ls.append(-i**5)
  ls.sort()
  for b in ls:
    if x + b in ls:
      a = x + b  
      break
  if a < 0:
    print(-1*int(pow(-a, 0.2)), end=' ')
  else:
    print(int(pow(a, 0.2)), end=' ')
  if b < 0:
    print(-1*int(pow(-b, 0.2)), end=' ')
  else:
    print(int(pow(b, 0.2)), end=' ')
  


if __name__ == '__main__':
  main()

Fixed submission:
def main():
  from itertools import combinations
  x = int(input())
  ls = [0]
  a = 0
  b = 0
  if x == 1:
    print(0, -1)
    exit()
  for i in range(1, 200):
    ls.append(i**5)
    ls.append(-i**5)
  ls.sort()
  for b in ls:
    if x + b in ls:
      a = x + b  
      break
  if a < 0:
    print(-1*int(pow(-a, 0.2)), end=' ')
  else:
    print(int(pow(a, 0.2)), end=' ')
  if b < 0:
    print(-1*int(pow(-b, 0.2)), end=' ')
  else:
    print(int(pow(b, 0.2)), end=' ')
  


if __name__ == '__main__':
  main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n, k = map(int, input().split(' '))
  A = list(range(n+1))
  ans = 0
  for i in range(k, n+2):
    tmp_min = sum(A[:i])
    tmp_max = sum(A[n+1-i:])
    ans += tmp_max - tmp_min + 1
  print(ans)
    

if __name__ == '__main__':
  main()

Fixed submission:
def main():
  mod = 10**9 + 7
  n, k = map(int, input().split(' '))
  A = list(range(n+1))
  A_rev = A[::-1]
  cumsum_A = [0]
  cumsum_A_rev = [0]
  for i in range(len(A)):
    cumsum_A.append(A[i]+cumsum_A[i])
    cumsum_A_rev.append(A_rev[i]+cumsum_A_rev[i])
  ans = 0
  
  for i in range(k, n+2):
    tmp_min = cumsum_A[i]
    tmp_max = cumsum_A_rev[i]
    ans += (tmp_max - tmp_min + 1)
  print(ans%mod)
    

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)

n= int(input())
ans = 0
for i in range(1, k+1):
  for j in range(1, k+1):
    for k in range(1, k+1):
      ans += gcd(i, j, k)
print(ans)

Fixed submission:
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)

n= int(input())
ans = 0
for i in range(1, n+1):
  for j in range(1, n+1):
    for k in range(1, n+1):
      ans += gcd(i, j, k)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

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

n= int(input())
ans = 0
for i in range(1, k+1):
  for j in range(1, k+1):
    for k in range(1, k+1):
      ans += gcd(i, j, k)
print(ans)

Fixed submission:
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)

n= int(input())
ans = 0
for i in range(1, n+1):
  for j in range(1, n+1):
    for k in range(1, n+1):
      ans += gcd(i, j, k)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
 
r = s.count('R')
g = s.count('G')
b = s.count('B')
 
ans = r*g*b
 
for i in range(n):
  for j in range(i+1, n, 2):
    if s[i] != s[j] and s[i] != s[(i+j)/2] and s[(i+j)/2] != s[j]:
      count -= 1
print(count)

Fixed submission:
n = int(input())
s = input()
 
r = s.count('R')
g = s.count('G')
b = s.count('B')
 
ans = r*g*b
 
for i in range(n):
  for j in range(i+2, n, 2):
    if s[i] != s[j] and s[i] != s[int((i+j)/2)] and s[int((i+j)/2)] != s[j]:
      ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n, s = input().split(' ')
n = int(n)

r = s.count('R')
g = s.count('G')
b = s.count('B')

ans = r*g*b

for i in range(n):
  for j in range(i+1, n, 2):
    if s[i] != s[j] and s[i] != s[(i+j)/2] and s[(i+j)/2] != s[j]:
      count -= 1
print(count)

Fixed submission:
n = int(input())
s = input()
 
r = s.count('R')
g = s.count('G')
b = s.count('B')
 
ans = r*g*b
 
for i in range(n):
  for j in range(i+2, n, 2):
    if s[i] != s[j] and s[i] != s[int((i+j)/2)] and s[int((i+j)/2)] != s[j]:
      ans -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n = int(input())
  dict = {}
  for i in range(n):
    s = input()
    if s not in dict:
      dict[s] = 1
    else:
      dict[s] += 1
  max_name = sorted([kv[0] for kv in dict.items() if kv[1] == max(dict.values())])
  for name in max_name:
    print(name)


if __name__ == '__main__':
  main()

Fixed submission:
def main():
  n = int(input())
  dict = {}
  for i in range(n):
    s = input()
    dict.setdefault(s, 0)
    dict[s] += 1
  max_val = 0
  ans_ls = []
  for kv in dict.items():
    if kv[1] > max_val:
      max_val = kv[1]
      ans_ls = [kv[0]]    
    elif kv[1] == max_val:
      ans_ls.append(kv[0])
  ans_ls = sorted(ans_ls)
  for name in ans_ls:
    print(name)
 
 
if __name__ == '__main__':
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n = int(input())
  ls = []
  ls_count = []
  for i in range(n):
    item = input()
    if item not in ls:
      ls.append(item)
      ls_count.append(1)
    else:
      ls_count[ls.index(item)] += 1
  max_count = max(ls_count)
  max_index = [i for i, n in enumerate(ls_count) if n == max_count]
  ans = []
  for idx in max_index:
    ans.append(ls[idx])
  ans = sorted(ans)
  for itm in ans:
    print(itm)
  

if __name__ == '__main__':
  main()

Fixed submission:
def main():
  n = int(input())
  dict = {}
  for i in range(n):
    s = input()
    dict.setdefault(s, 0)
    dict[s] += 1
  max_val = 0
  ans_ls = []
  for kv in dict.items():
    if kv[1] > max_val:
      max_val = kv[1]
      ans_ls = [kv[0]]    
    elif kv[1] == max_val:
      ans_ls.append(kv[0])
  ans_ls = sorted(ans_ls)
  for name in ans_ls:
    print(name)
 
 
if __name__ == '__main__':
  main()

Buggy python submission (verdict: Runtime Error):
def main():
  n = int(input())
  ls = []
  ls_count = []
  for i in range(n):
    item = input()
	if not item in ls:
      ls.append('item')
      ls_count.append(1)
    else:
      ls_count[ls.index(item)] += 1
  max_count = max(ls_count)
  max_index = [i for i, n in enumerate(ls_count) if n == max_count]
  ans = []
  for idx in max_index:
    ans.append(ls[idx])
  ans = sorted(ans)
  for itm in ans:
    print(itm)
  

if __name__ == '__main__':
  main()

Fixed submission:
def main():
  n = int(input())
  dict = {}
  for i in range(n):
    s = input()
    dict.setdefault(s, 0)
    dict[s] += 1
  max_val = 0
  ans_ls = []
  for kv in dict.items():
    if kv[1] > max_val:
      max_val = kv[1]
      ans_ls = [kv[0]]    
    elif kv[1] == max_val:
      ans_ls.append(kv[0])
  ans_ls = sorted(ans_ls)
  for name in ans_ls:
    print(name)
 
 
if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
  for j in range(n+1-i):
    k = n - i - j
    if 10000*i + 5000*j + 1000*k == y:
      print(i, j, k)
      break
  else:
    continue
  break

Fixed submission:
n, y = map(int, (input().split()))
 
for i in range(n+1):
  for j in range(n+1-i):
    k = n - i - j
    if 10000*i + 5000*j + 1000*k == y:
      print(i, j, k)
      break
  else:
    continue
  break
else:
  print(-1, -1, -1)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
s = input()
t = input()

def gcd(a, b):
    if b > a:
        a,b = b,a
    a,b = b,a % b
    if b == 0:
        return a
    else:
        return gcd(a,b)
def lcm(a, b):
	return a * b // gcd (a, b)

if s[0] != t[0]:
    print(-1)
    exit()
if gcd(n,m) == 1:
    print(lcm(n,m))
    exit()

ans = lcm(n,m)
nn = ans/n
mm = ans//m
e = max(nn,mm)
for i in range(1,ans,e):
    if i % (ans//n) != 0 or i%(ans//m) != 0:
        continue
    if s[i // nn] != t[i // mm]:
        print(-1)
        exit()
print(ans)


Fixed submission:
n,m = map(int,input().split())
s = input()
t = input()

def gcd(a, b):
    if b > a:
        a,b = b,a
    a,b = b,a % b
    if b == 0:
        return a
    else:
        return gcd(a,b)
def lcm(a, b):
	return a * b // gcd (a, b)

if s[0] != t[0]:
    print(-1)
    exit()
if gcd(n,m) == 1:
    print(lcm(n,m))
    exit()

ans = lcm(n,m)
nn = ans//n
mm = ans//m
e = lcm(nn,mm)
for i in range(1,ans,e):
    # print(i // (ans//n),i // (ans//m))
    # print(s[i // (ans//n)],t[i // (ans//m)])
    if s[i // (ans//n)] != t[i // (ans//m)]:
        print(-1)
        exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
s = input()
t = input()

def gcd(a, b):
    if b > a:
        a,b = b,a
    a,b = b,a % b
    if b == 0:
        return a
    else:
        return gcd(a,b)
def lcm(a, b):
	return a * b // gcd (a, b)

if s[0] != t[0]:
    print(-1)
    exit()
if gcd(n,m) == 1:
    print(lcm(n,m))
    exit()

ans = lcm(n,m)

for i in range(1,ans):
    if i % (ans//n) != 0 or i%(ans//m) != 0:
        continue
    if s[i // (ans//n)] == t[i // (ans//m)]:
        continue
    else:
        print(-1)
        exit()
print(ans)


Fixed submission:
n,m = map(int,input().split())
s = input()
t = input()

def gcd(a, b):
    if b > a:
        a,b = b,a
    a,b = b,a % b
    if b == 0:
        return a
    else:
        return gcd(a,b)
def lcm(a, b):
	return a * b // gcd (a, b)

if s[0] != t[0]:
    print(-1)
    exit()
if gcd(n,m) == 1:
    print(lcm(n,m))
    exit()

ans = lcm(n,m)
nn = ans//n
mm = ans//m
e = lcm(nn,mm)
for i in range(1,ans,e):
    # print(i // (ans//n),i // (ans//m))
    # print(s[i // (ans//n)],t[i // (ans//m)])
    if s[i // (ans//n)] != t[i // (ans//m)]:
        print(-1)
        exit()
print(ans)