Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = [input() for i in range(n)]
ls.sort()
p = []
k = 0
for j in range(n-1):
    if ls[j] == ls[j+1]:
        k += 1
    else:
        p.append(k)
        k = 0
p.append(k)
new = list(set(ls))
new.sort()
for l in range(len(p)):
    if p[l] == max(p):
        print(new[l])
        

Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = [input() for i in range(n)]
ls.sort()
p = []
k = 0
for j in range(n-1):
    if ls[j] == ls[j+1]:
        k += 1
    else:
        p.append(k)
        k = 0
p.append(k)
new = list(set(ls))
new.sort()
for l in range(len(p)):
    if p[l] == max(p):
        print(new[l])
        

Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = [input() for o in range(n)]
a = [0 for j in range(len(set(ls)))]
ls.sort()
u = list(set(ls))
u.sort()
p = 0
for i in range(n):
    if i ==0:
        a[i] += 1
    else:
        if ls[i] == ls[i-1]:
            a[p] += 1
        else:
            p +=1
            a[p] +=1
t = max(a)
r = 0
for l in range(len(a)):
    if a[l] != t:
        u.remove(u[r])
    else:
        r +=1
[print(e) for e in u]


Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = [input() for o in range(n)]
a = [0 for j in range(len(set(ls)))]
ls.sort()
u = list(set(ls))
u.sort()
p = 0
for i in range(n):
    if i ==0:
        a[i] += 1
    else:
        if ls[i] == ls[i-1]:
            a[p] += 1
        else:
            p +=1
            a[p] +=1
t = max(a)
r = 0
for l in range(len(a)):
    if a[l] != t:
        u.remove(u[r])
    else:
        r +=1
[print(e) for e in u]


Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = [input() for o in range(n)]
a = [0 for j in range(len(set(ls)))]
ls.sort()
u = list(set(ls))
u.sort()
p = 0
for i in range(n):
    if i ==0:
        a[i] += 1
    else:
        if ls[i] == ls[i-1]:
            a[p] += 1
        else:
            p +=1
            a[p] +=1
t = max(a)
r = 0
for l in range(len(a)):
    if a[l] != t:
        u.remove(u[r])
    else:
        r +=1
for q in range(len(u)):
    print(u[q])


Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
a = c.most_common()[0][1]
t = len(set(ls))
b = [c.most_common()[p][0] for p in range(t) if c.most_common()[p][1] == a]
b.sort()
for k in range(len(b)):
    print(b[k])


Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
a = c.most_common()[0][1]
b = [c.most_common()[p][0] for p in range(len(c.most_common())) if c.most_common()[p][1] == a]
b.sort()
for k in range(len(b)):
    print(b[k])


Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
a = c.most_common()[0][1]
b = []
for j in range(len(c.most_common())):
    if c.most_common()[j][1] == a:
        b.append(c.most_common()[j][0])
b.sort()
for k in range(len(b)):
    print(b[k])

Fixed submission:
import collections
n = int(input())
ls = [input() for i in range(n)]
c = collections.Counter(ls)
mx = max(c.values())
A = [e for e,j in c.items() if j == mx]
A.sort()
for p in A:
  print(p)