Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
s = Counter(s)
s = s.most_common()

# ansの初期化
ans = []
ans.append(s[0][0])
cnt = s[0][1]

for i in range(1, n):
  if (s[i][1] < cnt):
    break
  else:
    ans.append(s[i][0])

for s in sorted(ans):
  print(s)

Fixed submission:
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
s = Counter(s)
s = s.most_common()

# ansの初期化
ans = []
ans.append(s[0][0])
cnt = s[0][1]

if (len(s) != 1):
  for i in range(1, n):
    if (s[i][1] < cnt):
      break
    else:
      ans.append(s[i][0])

for s in sorted(ans):
  print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]

s_cnt = [0]*n
for i in range(n):
  s_cnt[s.index(s[i])] += 1

cnt_max = max(s_cnt)
s_unique = []
for i in range(n):
  if (s_cnt[i] == cnt_max):
    s_unique.append(s[i])

for s in sorted(s_unique):
  print(s)

Fixed submission:
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
s = Counter(s)
s = s.most_common()

# ansの初期化
ans = []
ans.append(s[0][0])
cnt = s[0][1]

if (len(s) != 1):
  for i in range(1, n):
    if (s[i][1] < cnt):
      break
    else:
      ans.append(s[i][0])

for s in sorted(ans):
  print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]
s = sorted(s)

s_cnt = [0]*n
for i in range(n):
  s_cnt[s.index(s[i])] += 1

s_cnt_max = max(s_cnt)
for i in range(n):
  if (s_cnt[i] == s_cnt_max):
  	print(s[i])

Fixed submission:
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
s = Counter(s)
s = s.most_common()

# ansの初期化
ans = []
ans.append(s[0][0])
cnt = s[0][1]

if (len(s) != 1):
  for i in range(1, n):
    if (s[i][1] < cnt):
      break
    else:
      ans.append(s[i][0])

for s in sorted(ans):
  print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]

s_unique   = []
s_cnt      = [0]*n
unique_num = 0
for i in range(n):
  # 新しい文字列の場合は配列に加える
  if (not(s[i] in s_unique)):
  	s_unique.append(s[i])
  else:
    s_cnt[s_unique.index(s[i])] += 1

# 最大カウントの要素で再構成
cnt_max = max(s_cnt)
s_max = []
for i in range(n):
  if (s_cnt[i] == cnt_max):
    s_max.append(s_unique[i])

s_max = sorted(s_max)
for s in s_max:
  print(s)

Fixed submission:
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
s = Counter(s)
s = s.most_common()

# ansの初期化
ans = []
ans.append(s[0][0])
cnt = s[0][1]

if (len(s) != 1):
  for i in range(1, n):
    if (s[i][1] < cnt):
      break
    else:
      ans.append(s[i][0])

for s in sorted(ans):
  print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]

s_unique   = []
s_cnt      = [0]*n
unique_num = 0
for i in range(n):
  # 新しい文字列の場合は配列に加える
  if (not(s[i] in s_unique)):
  	s_unique.append(s[i])
  else:
    s_cnt[s_unique.index(s[i])] += 1

# 最大カウントの要素で再構成
cnt_max = max(s_cnt)
s_max = []
for i in range(n):
  if (s_cnt[i] == cnt_max):
    s_max.append(s_unique[i])

s_max = sorted(s_max)
for s in s_max:
  print(s)

Fixed submission:
from collections import Counter

n = int(input())
s = [input() for i in range(n)]
s = Counter(s)
s = s.most_common()

# ansの初期化
ans = []
ans.append(s[0][0])
cnt = s[0][1]

if (len(s) != 1):
  for i in range(1, n):
    if (s[i][1] < cnt):
      break
    else:
      ans.append(s[i][0])

for s in sorted(ans):
  print(s)