Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
input=sys.stdin.readline
N=int(input())
d=Counter(list(input()[:-1] for _ in range(N)))
L=[]
for k, v in d.items():
 if v == max(d.values()):
  L.append(k)
L.sort()
for i in L:
 print(i)

Fixed submission:
n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter
input=sys.stdin.readline
N=int(input())
d=Counter(list(input() for _ in range(N)))
L=[]
for k, v in d.items():
 if v == max(d.values()):
  L.append(k)
L.sort()
for i in L:
 print(i)

Fixed submission:
n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict
d=defaultdict(int)
N=int(input())
L=[]
input=sys.stdin.readline
for _ in range(N):
 s=input()
 d[s]+=1
for k, v in d.items():
 if v == max(d.values()):
  L.append(k)
L.sort()
for i in L:
 print(i)

Fixed submission:
n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)

Buggy python submission (verdict: Time Limit Exceeded):

from collections import defaultdict
d=defaultdict(int)
N=int(input())
L=[]
for _ in range(N):
 s=input()
 d[s]+=1
for k, v in d.items():
 if v == max(d.values()):
  L.append(k)
L.sort()
for i in L:
 print(i)

Fixed submission:
n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
d=defaultdict(int)
N=int(input())
L=[]
for _ in range(N):
 s=input()
 d[s]+=1
for k, v in d.items():
 if v == max(d.values()):
  L.append(k)
L.sort()
for i in L:
 print(i)

Fixed submission:
n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)