Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    inp = input()
    if inp in s:
        s[s.index(inp)+1] += 1
    else:
        s.append(inp)
        s.append(1)

chknum = s[1]
for i,v in enumerate(s):
    if i%2 == 1:
        chknum = max(chknum, v)


ind = [i-1 for i, x in enumerate(s) if x == chknum]

ans = []
for i in ind:
    ans.append(s[i])
    # print(s[i])

ans.sort()
for i in ans:
    print(i)

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c = Counter(s)
m = 0
for v in c.values():
	m = max(m, v)
ans = []
for k, v in c.items():
	if v == m:
		ans.append(k)
ans.sort()
print(*ans, sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
t = {}
for i in range(n):
    inp = input()
    if inp in s:
        t[inp] += 1
    else:
        s.append(inp)
        t[inp] = 1

keys = list(t.keys())
values = list(t.values())
ans = []
for j in [i for i,v in enumerate(values) if v == max(values)]:
    ans.append(keys[j])
ans.sort()
for i in ans:
    print(i)

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c = Counter(s)
m = 0
for v in c.values():
	m = max(m, v)
ans = []
for k, v in c.items():
	if v == m:
		ans.append(k)
ans.sort()
print(*ans, sep="\n")

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

c = collections.Counter(s)
keys = list(c.keys())
values = list(c.values())
ans = []
for i,v in enumerate(values):
    if v == max(values):
        ans.append(keys[i])
ans.sort()
for i in ans:
    print(i)

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c = Counter(s)
m = 0
for v in c.values():
	m = max(m, v)
ans = []
for k, v in c.items():
	if v == m:
		ans.append(k)
ans.sort()
print(*ans, sep="\n")

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

tmp = s[:]
tmp = list(set(tmp))
cnt = []
# for i in tmp:
#     cnt.append([i, s.count(i)])
for i in tmp:
    cnt.append(s.count(i))

maxIndex = [i for i,v in enumerate(cnt) if v == max(cnt)]

ans = []
for i in maxIndex:
    ans.append(tmp[i])
# m = 0
# for i in cnt:
#     if m == i[1]:
#         ans.append(i[0])
#     elif m < i[1]:
#         ans.clear()
#         ans.append(i[0])
#         m = i[1]

ans.sort()
for i in ans:
    print(i)

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c = Counter(s)
m = 0
for v in c.values():
	m = max(m, v)
ans = []
for k, v in c.items():
	if v == m:
		ans.append(k)
ans.sort()
print(*ans, sep="\n")

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

tmp = s[:]
tmp = list(set(tmp))
cnt = []
for i in tmp:
    cnt.append([i, s.count(i)])

ans = []
m = 0
for i in cnt:
    if m == i[1]:
        ans.append(i[0])
    elif m < i[1]:
        ans.clear()
        ans.append(i[0])
        m = i[1]

ans.sort()
for i in ans:
    print(i)

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c = Counter(s)
m = 0
for v in c.values():
	m = max(m, v)
ans = []
for k, v in c.items():
	if v == m:
		ans.append(k)
ans.sort()
print(*ans, sep="\n")