Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(S)):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]

Fixed submission:
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(set(S))):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  [print(a) for a in sorted(S)]
else:
  c = collections.Counter(S)
  ans = sorted([i[0] for i in c.items() if i[1] == c.most_common()[0][1]])
  [print(a) for a in ans]


Fixed submission:
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(set(S))):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
S = [input() for _ in range(N)]

c = collections.Counter(S)

ans = sorted([i[0] for i in c.items() if i[1] == c.most_common()[0][1]])
  
[print(a) for a in ans]


Fixed submission:
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(set(S))):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
 
dic = {}
for i in range(N):
  S = input()
  if S in dic:
    dic[S] += 1
  else:
    dic[S] = 1
maxval = max(dic.values())
 
keys = [k for k, v in dic.items() if  v == max(dic.values())]
[print(sorted(keys)[i]) for i in range(len(keys))]

Fixed submission:
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(set(S))):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())

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

maxval = max(dic.values())

keys = [k for k, v in dic.items() if  v == max(dic.values())]
[print(sorted(keys)[i]) for i in range(len(keys))]

Fixed submission:
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(set(S))):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N = int(input())
c = collections.Counter([input() for _ in range(N)])
[print(sorted([k for k, v in c.items() if  v == max(c.values())])[i]) \
 for i in range(len([k for k, v in c.items() if  v == max(c.values())]))]

Fixed submission:
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(set(S))):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]

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

import collections
c = collections.Counter(s)

keys = [k for k, v in c.items() if  v == max(c.values())]
[print(sorted(keys)[i]) for i in range(len(keys))]

Fixed submission:
import collections
N = int(input())
S = [input() for _ in range(N)]

if len(S) == len(set(S)):
  ans = S
else:
  ans = []
  c = collections.Counter(S)
  c_common = c.most_common()
  max_vote = c_common[0][1]
  for k in range(len(set(S))):
    if c_common[k][1]== max_vote:
      ans.append(c_common[k][0])
    else:
      break
[print(a) for a in sorted(ans)]