Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
cnt = 0
sum = 0
flag = 0
T = X = Y = 0 
for i in range(N):
        cnt = x[i][0] - T
        sum = abs(x[i][1]- X) + abs(x[i][2]- Y)
        T = x[i][0]
        X = x[i][1]
        Y = x[i][2]
    if cnt < sum or cnt % 2 != sum % 2:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")


Fixed submission:
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
cnt = 0
sum = 0
flag = 0
T = X = Y = 0
for i in range(N):
    cnt = x[i][0] - T
    sum = abs(x[i][1]- X) + abs(x[i][2]- Y)
    T = x[i][0]
    X = x[i][1]
    Y = x[i][2]
    if cnt < sum or cnt % 2 != sum % 2:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
cnt = 0
sum = 0
flag = 0
for i in range(N):
    if i == 0:
        cnt = x[i][0]
        sum = x[i][1]
    else:
        cnt = x[i][0] - x[i-1][0]
        sum = x[i][1]+x[i][2] - x[i-1][1]+x[i-1][2]
    if cnt >= sum and cnt % sum == 0:
        flag = 0
    else:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")


Fixed submission:
N = int(input())
x = [list(map(int, input().split())) for i in range(N)]
cnt = 0
sum = 0
flag = 0
T = X = Y = 0
for i in range(N):
    cnt = x[i][0] - T
    sum = abs(x[i][1]- X) + abs(x[i][2]- Y)
    T = x[i][0]
    X = x[i][1]
    Y = x[i][2]
    if cnt < sum or cnt % 2 != sum % 2:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int, input().spilit())
if(a>=b):
  print("delicious")
else:
  if(b-a >x):
    print("dangerous")
  else:
    print("safe")

Fixed submission:
x,a,b = map(int, input().split())
if(a>=b):
  print("delicious")
else:
  if(b-a >x):
    print("dangerous")
  else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
if A[A >= A.sum()/(4*M)].count()>=M:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np
N, M = map(int,input().split())
A = np.array(list(map(int,input().split())))
if len(A[A >= A.sum()/(4*M)])>=M:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import pandas as pd
N, M = map(int,input().split())
A = pd.Series(list(map(int,input().split())))
A[A >= A.sum()/(4*M)].count() >= M

Fixed submission:
import numpy as np
N, M = map(int,input().split())
A = np.array(list(map(int,input().split())))
if len(A[A >= A.sum()/(4*M)])>=M:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
A, B, K =map(int, input().split())
if K<A:
    A_after=A-K
elif K>=A:
    A_after=0
    if K-A<B:
        B_after=B-(K-A)
    elif K-A>=B:
        B_after=0
print(A_after, B_after)

Fixed submission:
A, B, K =map(int, input().split())
if K<A:
    A_after=A-K
    B_after=B
elif K>=A:
    A_after=0
    if K-A<B:
        B_after=B-(K-A)
    elif K-A>=B:
        B_after=0
print(A_after, B_after)

Buggy python submission (verdict: Runtime Error):
A, B, K =map(int, input().split())
if K<A:
    A_after=A-K
elif K>=A:
    A_after=0
    if K-A<B:
            B_after=B-(K-A)
        elif K-A>=B:
            B_after=0
print(A_after, B_after)

Fixed submission:
A, B, K =map(int, input().split())
if K<A:
    A_after=A-K
    B_after=B
elif K>=A:
    A_after=0
    if K-A<B:
        B_after=B-(K-A)
    elif K-A>=B:
        B_after=0
print(A_after, B_after)
Buggy python submission (verdict: Runtime Error):
A1, A2, A3= map(int, input().split())
sum=A1+A2+A3
if sum>=22:
    print(“bust”)
else:
    print(“win”)

Fixed submission:
A1, A2, A3= map(int, input().split())
sum=A1+A2+A3
if sum>=22:
    print('bust')
else:
    print('win')
Buggy python submission (verdict: Runtime Error):
import math
N = int(input()) 
factor = []
tmp = int(math.sqrt(N)) + 1
list = range(2,tmp)
for num in list[::-1]:
    while N % num == 0:
        N //= num
        factor.append(num)
        factor.append(N)
    if not factor:
        factor.append(N)
        factor.append(0)
    else:
        pass
    break
f=sum(factor)-1
print(f)

Fixed submission:
A,B = map(int,input().split())
if (A <= 9) and (B <=9):
    print(A*B)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input()) 
factor = []
tmp = int(math.sqrt(N)) + 1
list = range(2,tmp)
for num in list[::-1]:
    while N % num == 0:
        N //= num
        factor.append(num)
        factor.append(N)
    if not factor:
        factor.append(N)
        factor.append(0)
    else:
        pass
    break
f=sum(factor)-1
print(f)

Fixed submission:
A,B = map(int,input().split())
if (A <= 9) and (B <=9):
    print(A*B)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
if (A <= 9)&(B <= 9):
    return(A*B)
else:
    return(-1)

Fixed submission:
A,B = map(int,input().split())
if (A <= 9) and (B <=9):
    print(A*B)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input()) 
factor = []
tmp = int(math.sqrt(N)) + 1
list = range(2,tmp)
for num in list[::-1]:
    while N % num == 0:
        N //= num
        factor.append(num)
        factor.append(N)
    if not factor:
        factor.append(N)
        factor.append(1)
    else:
        pass
    break
if 
f=sum(factor)-2
print(f)

Fixed submission:
N = int(input())
import math
sqrtN = math.floor(math.sqrt(N))
list = range(1, sqrtN+1)
a=[]
for i in list[::-1]:
    while N%i == 0:
        a.append(int(i))
        a.append(int(N/i))
        break
    if not a:
        pass
    else:
        break
f = a[0]+a[1]-2
print(f)

Buggy python submission (verdict: Runtime Error):
import math
N = int(input()) 
factor = []
tmp = int(math.sqrt(N)) + 1
print(tmp)
list = range(2,tmp)
print(list[::-1])
for num in list[::-1]:
    while N % num == 0:
        N //= num
        factor.append(num)
        factor.append(N)
    if not factor:
        factor.append(N)
        factor.append(0)
        print("N="+str(N))
    else:
        pass
    break
f=factor[0]+factor[1]-1
print(f)
18

Fixed submission:
N = int(input())
import math
sqrtN = math.floor(math.sqrt(N))
list = range(1, sqrtN+1)
a=[]
for i in list[::-1]:
    while N%i == 0:
        a.append(int(i))
        a.append(int(N/i))
        break
    if not a:
        pass
    else:
        break
f = a[0]+a[1]-2
print(f)
Buggy python submission (verdict: Time Limit Exceeded):
N= int(input())
A= list(map(int,input().split()))
 
S= 1
for n in range(N):
  if A[n] == 0:
    S=0
    break
  elif S > 10**18:
    S = -1
  else:
    S *= A[n]
    if S > 10**18:
      S = -1
print(S)

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

A = sorted(A)

if A[0] == 0:
  print(0)
else:
  S = 1
  for n in range(N):
    S *= A[N-1-n]
    if S > 10**18:
      S = -1
      break
  print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int, input().split()))
A = list(map(int, input().split()))

B = [1]
hop = 0
ans = 0
for n in range(N):
    nc = A[B[n]-1]    
    if nc in B:
        idx = B.index(nc)
        loop = B[idx:]
        break
    B.append(nc)
    K -= 1
    ans = nc
    if K < 1:
        break

if K > 0:
    L = len(loop)
    K = K % L
    K -= 1
    ans = loop[K]
print(ans)

Fixed submission:
N,K = list(map(int, input().split()))
A = list(map(int, input().split()))
 
B = [1]
go = [0]*N
hop = 0
ans = 0
for n in range(N):
    nc = A[B[n]-1]
    if go[nc-1] == 1:
        idx = B.index(nc)
        loop = B[idx:]
        break
    B.append(nc)
    K -= 1
    go[nc-1] = 1
    ans = nc
    if K < 1:
        break
 
if K > 0:
    L = len(loop)
    K = K % L
    K -= 1
    ans = loop[K]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

S = []
cnt = 0
for n in range(N):
  temp = input()
  if not (temp in S):
    S.append(temp)
    cnt += 1

print(cnt)

Fixed submission:
N = int(input())

S = []
cnt = 0
for n in range(N):
  temp = input()
  S.append(temp)

S = set(S)
print(len(S))
Buggy python submission (verdict: Runtime Error):
N,M = list(map(int, sys.stdin.readline().rstrip().split())) 
A = list(map(int, sys.stdin.readline().rstrip().split())) 

s = 0
for n in range(M):
  s += A[n]
  
s -= N
if s < 0:
  print(-1)
else:
  print(s)

Fixed submission:
import sys
N,M = list(map(int, sys.stdin.readline().rstrip().split())) 
A = list(map(int, sys.stdin.readline().rstrip().split())) 

s = 0
for n in range(M):
  s += A[n]
  
s = N - s
if s < 0:
  print(-1)
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
K=int(sys.stdin.readline().rstrip())

def gcd(a,b):

    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

cnt1 = 0
cnt2 = 0
cnt3 = 0
for n1 in range(K):
    for n2 in range(K):
        temp = gcd(n1+1, n2+1)
        for n3 in range(K):
            cnt3 += gcd(temp, n3+1)
        

ans = cnt1 + cnt2 + cnt3
print(ans)

Fixed submission:
import sys

K=int(sys.stdin.readline().rstrip())
 
def gcd(a,b):

    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

cnt1 = 0
cnt2 = 0
cnt3 = 0
for n1 in range(0,K):
    cnt1 += n1+1
    for n2 in range(n1+1, K):
        temp = gcd(n1+1, n2+1)
        cnt2 += temp*6
        for n3 in range(n2+1, K):
            cnt3 += gcd(temp, n3+1)*6
        

ans = cnt1 + cnt2 + cnt3
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()    
# 1行ずつ取り出し
KN = input().strip(" ")
A = input().strip(" ")

K=int(KN[0])

X = K - int(A[-1])
temp = 0
for Ai in A:
  Y = int(Ai) - temp
  if Y > X:
    X = Y
  temp = int(Ai)

print(K-X)
  


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

ans = K - A[-1] + A[0]
for n in range(N-1):
  dis = A[n+1] - A[n]
  ans = max(ans, dis)
  
print(K-ans)

Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()    
# 1行ずつ取り出し
KN = lines[0].strip(" ")
A = lines[1].strip(" ")

K=int(KN[0])

X = K - int(A[-1])
temp = 0
for Ai in A:
  Y = int(Ai) - temp
  if Y > X:
    X = Y
  temp = int(Ai)

print(K-X)
  


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

ans = K - A[-1] + A[0]
for n in range(N-1):
  dis = A[n+1] - A[n]
  ans = max(ans, dis)
  
print(K-ans)

Buggy python submission (verdict: Runtime Error):
import sys
lines = sys.stdin.readlines()    
# 1行ずつ取り出し
KN = lines[0].strip(" ")
A = lines[1].strip(" ")

K=KN[0]

X = K - A[-1]
temp = 0
for Ai in A:
  Y = Ai - temp
  if Y > X:
    X = Y
  temp = Ai

print(K-X)
  

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

ans = K - A[-1] + A[0]
for n in range(N-1):
  dis = A[n+1] - A[n]
  ans = max(ans, dis)
  
print(K-ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

if N == 1:
  ans = 0
else:
  temp = 0
  for n in range(N-1):
    l, r = H[n], H[n+1]
    if r > l:
      temp = 0
    else:
      temp += 1
    ans = max(ans, temp)
    
print(ans)
  

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

if N == 1:
  ans = 0
else:
  temp = 0
  ans = 0
  for n in range(N-1):
    l, r = H[n], H[n+1]
    if r > l:
      temp = 0
    else:
      temp += 1
    ans = max(ans, temp)
    
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N==1:
  ans = 0
elif N==2:
  ans = 1:
else:
  ans = ((N-1)*N)//2 + N%2
  print(ans)
  
print(ans)
  
  
  

Fixed submission:
N = int(input())

if N==1:
  ans = 0
elif N==2:
  ans = 1
else:
  ans = ((N-1)*N)//2
  
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().spliit()))
C = []
for n in range(N):
  A, B = list(map(int, input().spliit()))
  C.append([A,B])
  
C = sorted(C, key=lambda x:x[0])

S = 0
n = 0
whilie S <= M:
  S += C[0][1]
  n += 1
print(S)
  
            
           

Fixed submission:
N, M = list(map(int, input().split()))
C = []
for n in range(N):
  A, B = list(map(int, input().split()))
  C.append([A,B])
  
C = sorted(C, key=lambda x:x[0])

S = 0
num = 0
n1 = 0
n2 = 0
while num < M:
  if n2 == C[n1][1]:
    n1 += 1
    n2 = 0
  S += C[n1][0]
  num += 1
  n2 += 1
 
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int,input().split()))

while M - 2 * N > 0:
  M -= 2
  N += 1

print(M // 2)

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

x = M - 2 * N
if x > 0:
  N += x // 4

print(min(N, M // 2))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 1
for i in range(N):
    ans *= A[i]
    if ans > 10**18 and 0 not in A:
        print(-1)
        break

if ans <= 10**18:
    print(ans)

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

if 0 in A:
    print(0)
    exit()

ans = 1
for i in range(N):
    ans *= A[i]
    if ans > 10**18:
        print(-1)
        break

if ans <= 10**18:
    print(ans)

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

ans = 1
for i in range(N):
    ans *= A[i]

if ans > 10**18:
    print(-1)
else:
    print(ans)

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

if 0 in A:
    print(0)
    exit()

ans = 1
for i in range(N):
    ans *= A[i]
    if ans > 10**18:
        print(-1)
        break

if ans <= 10**18:
    print(ans)
Buggy python submission (verdict: Runtime Error):
CA = [list(map(int, input().split())) for i in range(N)]

A = [0]*M
for i in range(N):
    for k in range(M):
        A[k] += CA[i][k+1]
for i in range(M):
    if A[i] < X:
        print('-1')
        exit() 

price = 0
ans = 10**10
A = [0]*M
for i in range(2**N):
    list = [1]*N
    for j in range(len(list)):
        if (i>>j) & 1:
            list[j] = 0
        for k in range(N):
            if list[k] == 1:
                for s in range(M):
                    A[s] += CA[k][s+1]
                price += CA[k][0]
        if all(A[m] >= X for m in range(M)):
            ans = min(ans,price)
    price = 0
print(ans)

Fixed submission:
N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for i in range(N)]

A = [0]*M
for i in range(N):
    for k in range(M):
        A[k] += CA[i][k+1]
for i in range(M):
    if A[i] < X:
        print('-1')
        exit() 

price = 0
ans = 10**10
A = [0]*M
for i in range(2**N):
    list = [1]*N
    for j in range(len(list)):
        if (i>>j) & 1:
            list[j] = 0
        price = 0
        A = [0]*M
        for k in range(N):
            if list[k] == 1:
                for s in range(M):
                    A[s] += CA[k][s+1]
                price += CA[k][0]
    if all(A[m] >= X for m in range(M)):
        ans = min(ans,price)
print(ans)
Buggy python submission (verdict: Runtime Error):
akasaka

Fixed submission:
S = input()
N = int(len(S))
a = 0
for i in range(0,int((N-1)/2)):
    if S[i] == S[-i-1]:
        a += 1
        
left = []
for i in range(0,int((N-1)/2)):
  left += S[i]
for i in range(0,int((N-1)/4)):
    if left[i] == left[-i-1]:
        a += 1

right = []
for i in range(0,int((N-1)/2)):
  right += S[-i-1]
for i in range(0,int((N-1)/4)):
    if right[i] == right[-i-1]:
        a += 1

if a == int((N-1)/2) + int((N-1)//4 * 2):
	print('Yes')
else :
    print('No')
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
set_bule = N//(A+B) * A
other = N - N//(A+B) * (A+B)
if 0 <= other <= A:
    hashi_ bule = other
else :
    hashi_bule = A
print(set_bule + hashi_bule)

Fixed submission:
N, A, B = map(int, input().split())
set_bule = N//(A+B) * A
other = N - N//(A+B) * (A+B)
hashi_bule=0
if 0 <= other <= A:
    hashi_bule = other
else :
    hashi_bule = A
print(set_bule + hashi_bule)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
set_bule = //(A+B) * A
other = N - N//(A+B) * (A+B)
if 0 <= other <= A:
    hashi_ bule = other
else :
    hashi_bule = A
print(set_bule + hashi_bule) 

Fixed submission:
N, A, B = map(int, input().split())
set_bule = N//(A+B) * A
other = N - N//(A+B) * (A+B)
hashi_bule=0
if 0 <= other <= A:
    hashi_bule = other
else :
    hashi_bule = A
print(set_bule + hashi_bule)
Buggy python submission (verdict: Runtime Error):
A = []
for _ in range(3):
    A += list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]

for i in range(0,N):
    for j in range(9):
        if B[i] ==  A[j]:
            A[j] = 0

if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or  A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0 :
    print('Yes')
else:
    print('No')

Fixed submission:
import math
N = int(input())
print(math.ceil(N/2))
Buggy python submission (verdict: Runtime Error):
A = []
for _ in range(3):
    A = list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]
for i in range(N):
    for j in range(9):
        if B[i] ==  A[j] :
            A[j] = 'a'
if A[0]==A[1]==A[2]=='a' or A[3]==A[4]==A[5]=='a' or A[6]==A[7]==A[8]=='a' or A[0]==A[3]==A[6]=='a' or A[1]==A[4]==A[7]=='a' or A[2]==A[5]==A[8]=='a' or  A[0]==A[4]==A[8]=='a' or A[2]==A[4]==A[6]=='a' :
    print('Yes')
else:
    print('No')

Fixed submission:
A = []
for _ in range(3):
    A += list(map(int, input().split()))
N = int(input())
B = [int(input()) for i in range(N)]

for i in range(0,N):
    for j in range(9):
        if B[i] ==  A[j]:
            A[j] = 0

if A[0]==A[1]==A[2]==0 or A[3]==A[4]==A[5]==0 or A[6]==A[7]==A[8]==0 or A[0]==A[3]==A[6]==0 or A[1]==A[4]==A[7]==0 or A[2]==A[5]==A[8]==0 or  A[0]==A[4]==A[8]==0 or A[2]==A[4]==A[6]==0 :
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count, check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')
Buggy python submission (verdict: Runtime Error):
#bA
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) #出現回数をまとめた辞書型作成

maximum = max(S.values())
list = sorted(key for key,value in s.items() if value==maximum)
#sを利用して、出現回数が最大のものを辞書順に並べたリストを作成

for i in list:
    print(i)

Fixed submission:
#bA
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) #出現回数をまとめた辞書型作成

maximum = max(s.values()) #
list = sorted(key for key,value in s.items() if value==maximum)
#sを利用して、出現回数が最大のものを辞書順に並べたリストを作成

for i in list:
    print(i)

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) #出現回数をまとめた辞書型作成

maximum = max(S.values())
list = sorted(key for key,value in s.items() if value==maximum))
#sを利用して、出現回数が最大のものを辞書順に並べたリストを作成

for i in list:
    print(i)

Fixed submission:
#bA
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) #出現回数をまとめた辞書型作成

maximum = max(s.values()) #
list = sorted(key for key,value in s.items() if value==maximum)
#sを利用して、出現回数が最大のものを辞書順に並べたリストを作成

for i in list:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) #出現回数をまとめた辞書型作成

dict = sorted(key for key,value in s.items() if value==max(s.values()))
for d in dict:
    print(d)

Fixed submission:
#bA
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S) #出現回数をまとめた辞書型作成

maximum = max(s.values()) #
list = sorted(key for key,value in s.items() if value==maximum)
#sを利用して、出現回数が最大のものを辞書順に並べたリストを作成

for i in list:
    print(i)
Buggy python submission (verdict: Runtime Error):
N, M =map(int, input().split())
if('Yes' if N==M else 'No')

Fixed submission:
N, M =map(int, input().split())
print('Yes' if N==M else 'No')

Buggy python submission (verdict: Runtime Error):
N, M =map(int, input())
if('Yes' if N==M else 'No')

Fixed submission:
N, M =map(int, input().split())
print('Yes' if N==M else 'No')
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
if A>=K:
    A -= K)
elif A<K  and B>K-A:
    A = 0
    B = B -(K-A)
else:
    A = B = 0
print(A, B, sep=' ')

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

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())
for i in range(K):
    if A>=1:
        A -= 1
    elif A==0 and B >=1:
        B -= 1
    elif A == B == 0:
        break
print(A, B, sep=' ')

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

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())
for i in range(K):
    if A>=1:
        A -= 1
    elif A==0 and B >=1:
        B -= 1
    elif A == B == 0:
        break
print(A, B, sep=' ')

Fixed submission:
A, B, K = map(int, input().split())
if A>=K:
    A = A - K
    print(A,B)
else:
    K -= A
    A = 0
    B = max(0,B-K)
    print(A,B)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S, T = input().split()
print(*[s+t for s,t in zip(S,T)], sep='')

Fixed submission:

A = int(input())
B = int(input())
if A != 1 and B != 1:
    print(1)
elif A != 2 and B != 2:
    print(2)
else:
    print(3)
Buggy python submission (verdict: Runtime Error):
S, T = input().split()
print(*[s+t for s,t in zip(S,T)], sep='')

Fixed submission:
N = int(input())
S, T = input().split()
list = []
for i in range(0,N):
    list.append(S[i])
    list.append(T[i])
print(*list, sep='')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S, T = input().split()
print(*s+t for s,t in zip(S,T), sep='')

Fixed submission:
N = int(input())
S, T = input().split()
list = []
for i in range(0,N):
    list.append(S[i])
    list.append(T[i])
print(*list, sep='')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()


for i in s:
    m = (ord(i) - ord('A') + n) % 26
    ans += chr(m + ord('A'))

print(ans)

Fixed submission:
N = int(input())
S = input()
ans = str()
for i in S:
	m = (ord(i) - ord('A') + N) % 26
	ans += chr(m + ord('A'))
print(ans)

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


for i in s:
    m = (ord(i) - ord('A') + n) % 26
    ans += chr(m + ord('A'))

print(ans)

Fixed submission:
N = int(input())
S = input()
ans = str()
for i in S:
	m = (ord(i) - ord('A') + N) % 26
	ans += chr(m + ord('A'))
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
for i in S:
	m = (ord(i) - ord('A') + N) % 26
    ans += chr(m +ord('A'))
print(ans)

Fixed submission:
N = int(input())
S = input()
ans = str()
for i in S:
	m = (ord(i) - ord('A') + N) % 26
	ans += chr(m + ord('A'))
print(ans)