Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip() for _ in range(n)]

s = []
cnt = [0] * n
_max = 0
for tmp in data:
  if tmp not in s:
    s.append(tmp)
  cnt[s.index(tmp)] += 1
  if _max < cnt[s.index(tmp)]:
    _max = cnt[s.index(tmp)]
    
results = []
for i in range(len(s)):
  if cnt[i] == _max:
    results.append(s[i])

results.sort()
for result in results:
  print(result)

Fixed submission:
n = int(input())

dic = {}
for i in range(n):
  s = input()
  if s in dic:
    dic[s] += 1
  else:
    dic[s] = 1

_max = 0
for v in dic.values():
  if _max < v:
    _max = v
dic2 = sorted(dic.items())

for (k,v) in dic2:
  if v == _max:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip() for _ in range(n)]

s = []
cnt = [0] * n
_max = 0
for tmp in data:
  if tmp not in s:
    s.append(tmp)
  else:
    cnt[s.index(tmp)] += 1
    if _max < cnt[s.index(tmp)]:
      _max = cnt[s.index(tmp)]
    
results = []
for i in range(len(s)):
  if cnt[i] == _max:
    results.append(s[i])

results.sort()
for result in results:
  print(result)

Fixed submission:
n = int(input())

dic = {}
for i in range(n):
  s = input()
  if s in dic:
    dic[s] += 1
  else:
    dic[s] = 1

_max = 0
for v in dic.values():
  if _max < v:
    _max = v
dic2 = sorted(dic.items())

for (k,v) in dic2:
  if v == _max:
    print(k)

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

s = []
cnt = [0] * n
_max = 0
for i in range(n):
  tmp = input()
  if tmp not in s:
    s.append(tmp)
  else:
    cnt[s.index(tmp)] += 1
    if _max < cnt[s.index(tmp)]:
      _max = cnt[s.index(tmp)]
    
results = []
for i in range(len(s)):
  if cnt[i] == _max:
    results.append(s[i])

results.sort()
for result in results:
  print(result)

Fixed submission:
n = int(input())

dic = {}
for i in range(n):
  s = input()
  if s in dic:
    dic[s] += 1
  else:
    dic[s] = 1

_max = 0
for v in dic.values():
  if _max < v:
    _max = v
dic2 = sorted(dic.items())

for (k,v) in dic2:
  if v == _max:
    print(k)

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

s = []
cnt = [0] * n
_max = 0
for i in range(n):
  tmp = input()
  if tmp not in s:
    s.append(tmp)
  else:
    cnt[s.index(tmp)] += 1
    if _max < cnt[s.index(tmp)]:
      _max = cnt[s.index(tmp)]
    
results = []
for i in range(len(cnt)):
  if cnt[i] == _max:
    results.append(s[i])

results.sort()
for result in results:
  print(result)

Fixed submission:
n = int(input())

dic = {}
for i in range(n):
  s = input()
  if s in dic:
    dic[s] += 1
  else:
    dic[s] = 1

_max = 0
for v in dic.values():
  if _max < v:
    _max = v
dic2 = sorted(dic.items())

for (k,v) in dic2:
  if v == _max:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n = int(input())

s = []
cnt = [0] * n
for i in range(n):
  tmp = input()
  tmp = tmp.strip()
  if tmp not in s:
    s.append(tmp)
  else:
    cnt[s.index(tmp)] += 1

_max = 0
for c in cnt:
  if _max < c:
    _max = c
    
results = []
for i in range(len(cnt)):
  if cnt[i] == _max:
    results.append(s[i])

results.sort()
for result in results:
  print(result)

Fixed submission:
n = int(input())

dic = {}
for i in range(n):
  s = input()
  if s in dic:
    dic[s] += 1
  else:
    dic[s] = 1

_max = 0
for v in dic.values():
  if _max < v:
    _max = v
dic2 = sorted(dic.items())

for (k,v) in dic2:
  if v == _max:
    print(k)

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

s = []
cnt = [0] * n
for i in range(n):
  tmp = input()
  if tmp not in s:
    s.append(tmp)
  else:
    cnt[s.index(tmp)] += 1

_max = 0
for c in cnt:
  if _max < c:
    _max = c
results = []
for i in range(len(cnt)):
  if cnt[i] == _max:
    results.append(s[i])

results.sort()

for result in results:
  print(result)

Fixed submission:
n = int(input())

dic = {}
for i in range(n):
  s = input()
  if s in dic:
    dic[s] += 1
  else:
    dic[s] = 1

_max = 0
for v in dic.values():
  if _max < v:
    _max = v
dic2 = sorted(dic.items())

for (k,v) in dic2:
  if v == _max:
    print(k)

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

def index_Multi(List,liter):
    #Listはリスト本体・literは検索したい文字
    index_L = []
    for i in range(len(List)):
        if liter == List[i]:
            index_L.append(i)
    return index_L

s = []
cnt = [0] * n

for i in range(n):
  tmp = input()
  if tmp not in s:
    s.append(tmp)
  else:
    cnt[s.index(tmp)] += 1
    
_max = 0
for c in cnt:
  if _max < c:
    _max = c


inds = index_Multi(cnt,_max)
results = []
for ind in inds:
  results.append(s[ind])

results.sort()

for result in results:
  print(result)




Fixed submission:
n = int(input())

dic = {}
for i in range(n):
  s = input()
  if s in dic:
    dic[s] += 1
  else:
    dic[s] = 1

_max = 0
for v in dic.values():
  if _max < v:
    _max = v
dic2 = sorted(dic.items())

for (k,v) in dic2:
  if v == _max:
    print(k)