Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = [input() for i in range(N)]
L = list(set(s))
S = [s.count(j) for j in L]
M = max(S)
l = len(S)
A = [L[k] for k in range(l) if S[k] == M]
A.sort()
[print(m) for m in A]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
C = []
M = 1
pS = ''
pM = 0
for i in range(N):
  s = input()
  if s in S:
    n = S.index(s)
    C[n] += 1
    if C[n] > M:
      if pS != s:
        pS = s
        pM = M
      M = C[n]
      if M - pM > N - i:
        print(s)
        exit()
  else:
    S.append(s)
    C.append(1)
l = len(C)
A = [S[j] for j in range(l) if C[j] == M]
A.sort()
[print(k) for k in A]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
C = []
M = 1
for i in range(N):
  s = input()
  if s in S:
    n = S.index(s)
    C[n] += 1
    if C[n] > M:
      M = C[n]
  else:
    S.append(s)
    C.append(1)
l = len(C)
A = [S[j] for j in range(l) if C[j] == M]
A.sort()
[print(k) for k in A]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
C = []
for i in range(N):
  s = input()
  if s in S:
    n = S.index(s)
    C[n] += 1
    if C[n] > N // 2:
      print(S[n])
      exit()
  else:
    S.append(s)
    C.append(1)
M = max(C)
l = len(C)
A = [S[j] for j in range(l) if C[j] == M]
A.sort()
[print(k) for k in A]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
C = []
for i in range(N):
  s = input()
  if s in S:
    C[S.index(s)] += 1
  else:
    S.append(s)
    C.append(1)
M = max(C)
l = len(C)
A = [S[j] for j in range(l) if C[j] == M]
A.sort()
[print(k) for k in A]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [input() for i in range(N)]
c = [L.count(j) for j in L]
C = max(c)
l = [L[k] for k in range(N) if c[k] == C]
m = list(set(l))
m.sort()
[print(n) for n in m]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [input() for i in range(N)]
l = list(set(L))
c = [L.count(j) for j in l]
C = max(c)
A = [l[k] for k in range(len(l)) if c[k] == C]
A.sort()
[print(l) for l in A]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [input() for i in range(N)]
l = list(set(L))
l.sort()
c = [L.count(j) for j in l]
C = max(c)
[print(l[k]) for k in range(len(l)) if c[k] == C]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = [input() for i in range(N)]
l = list(set(L))
l.sort()
c = [L.count(j) for j in l]
C = max(c)
[print(k) for k in l if L.count(k) == C]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = []
for i in range(N):
  L.append(input())
l = list(set(L))
l.sort()
c = [L.count(j) for j in l]
C = max(c)
[print(k) for k in l if L.count(k) == C]

Fixed submission:
import collections
N = int(input())
l = [input() for i in range(N)]
L = collections.Counter(l)
a = L.most_common()
M = a[0][1]
A = [j[0] for j in a if j[1] == M]
[print(k) for k in sorted(A)]