Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]
S_set = list(set(S))
#print(S_set)
word_buf = []
cnt = []
mmax = -1
cnt.append(S.count(S_set[0]))
word_buf.append(S_set[0])
mmax = max(mmax,cnt[0])
for i in range(1,len(S_set)) :
    cnt.append(S.count(S_set[i]))
    if cnt[i] < mmax :
        pass
    elif cnt[i] == mmax :
        word_buf.append(S_set[i])
    else :
        word_buf.clear()
        word_buf.append(S_set[i])
    mmax = max(mmax,cnt[i]) # 現時点での最大値
word_buf = sorted(word_buf)
#print("--")
for i in range(len(word_buf)) :
    print(word_buf[i])

Fixed submission:
from collections import Counter
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S = Counter(S).most_common()
c = S[0][1]

print(*sorted([a for a,s in S if s==c]),sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]
S_set = list(set(S))
#print(S_set)
word_buf = []
cnt = []
mmax = -1

for i in range(len(S_set)) :
    cnt.append(S.count(S_set[i]))
    if i == 0 :
        word_buf.append(S_set[i])
    else :
        if cnt[i] < mmax :
            pass
        elif cnt[i] == mmax :
            word_buf.append(S_set[i])
        elif cnt[i] > mmax :
            word_buf.clear()
            word_buf.append(S_set[i])
    mmax = max(mmax,cnt[i]) # 現時点での最大値
word_buf = sorted(word_buf)
#print("--")
for i in range(len(word_buf)) :
    print(word_buf[i])

Fixed submission:
from collections import Counter
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S = Counter(S).most_common()
c = S[0][1]

print(*sorted([a for a,s in S if s==c]),sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]
S_set = sorted(list(set(S)))
#print(S_set)
cnt = [0 for i in range(len(S_set))]
word_buf = []
mmax = -1

for i in range(len(S_set)) :
    cnt[i] = S.count(S_set[i])
    if i == 0 :
        word_buf.append(S_set[i])
    else :
        if cnt[i] < mmax :
            pass
        elif cnt[i] == mmax :
            word_buf.append(S_set[i])
        elif cnt[i] > mmax :
            word_buf.clear()
            word_buf.append(S_set[i])
    mmax = max(mmax,cnt[i]) # 現時点での最大値
#print("--")
for i in range(len(word_buf)) :
    print(word_buf[i])

Fixed submission:
from collections import Counter
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S = Counter(S).most_common()
c = S[0][1]

print(*sorted([a for a,s in S if s==c]),sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]
S_set = sorted(list(set(S)))
#print(S_set)
cnt = [0 for i in range(len(S_set))]
word_buf = []
mmax = -1

for i in range(len(S_set)) :
    cnt[i] = S.count(S_set[i])
    if i == 0 :
        word_buf.append(S_set[i])
    else :
        if cnt[i] < mmax :
            pass
        elif cnt[i] == mmax :
            word_buf.append(S_set[i])
        elif cnt[i] > mmax :
            word_buf.clear()
            word_buf.append(S_set[i])
    mmax = max(mmax,cnt[i]) # 現時点での最大値

word_buf = sorted(word_buf)
for i in range(len(word_buf)) :
    print(word_buf[i])

Fixed submission:
from collections import Counter
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S = Counter(S).most_common()
c = S[0][1]

print(*sorted([a for a,s in S if s==c]),sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S_set = sorted(list(set(S)))
#print(S_set)
cnt = [0 for i in range(len(S_set))]
word_buf = []
mmax = -1

for i in range(len(S_set)) :
    cnt[i] = S.count(S_set[i])

    if i == 0 :
        word_buf.append(S_set[i])
    else :
        if cnt[i] < mmax :
            pass
        elif cnt[i] == mmax :
            word_buf.append(S_set[i])
        elif cnt[i] > mmax :
            word_buf.clear()
            word_buf.append(S_set[i])
    mmax = max(mmax,cnt[i]) # 現時点での最大値

word_buf = sorted(word_buf)
for i in range(len(word_buf)) :
    print(word_buf[i])

Fixed submission:
from collections import Counter
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S = Counter(S).most_common()
c = S[0][1]

print(*sorted([a for a,s in S if s==c]),sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S_set = list(set(S))

mmax = -1
word_buf = []
cnt = 0

for i in range(len(S_set)) :
    cnt = S.count(S_set[i])
    mmax = max(mmax,cnt)

for i in range(len(S_set)) :
    if S.count(S_set[i]) == mmax :
        word_buf.append(S_set[i])

word_buf = sorted(word_buf)
for i in range(len(word_buf)) :
    print(word_buf[i])

Fixed submission:
from collections import Counter
N = int(input())
S = [''] * N
for i in range(N) :
    S[i] = input()
S = Counter(S).most_common()
c = S[0][1]

print(*sorted([a for a,s in S if s==c]),sep="\n")