n = int(eval(input()))

s = [eval(input()) for _ in range(n)]

d = {}

for w in s:

    if w not in d:

        d[w] = 0

    d[w] += 1

d2 = sorted(list(d.items()), key=lambda x:x[1], reverse=True)

maxcnts = [w[0] for w in d2 if w[1] == d2[0][1]]

maxcnts.sort()

for ans in maxcnts:

    print(ans)
from collections import Counter

 

 

stdin = open(0)

 

N = int(stdin.readline())

S = stdin.read().split()

 

counter = Counter(S)

max_cnt = max(counter.values())

names = [name for name, cnt in counter.items() if cnt == max_cnt]

names.sort()

 

print(*names, sep='\n')

n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
d = {}
for w in s:
    if w not in d:
        d[w] = 0
    d[w] += 1
d2 = sorted(list(d.items()), key=lambda x: x[1], reverse=True)
maxcnts = [w[0] for w in d2 if w[1] == d2[0][1]]
maxcnts.sort()
for ans in maxcnts:
    print(ans)

from collections import Counter

stdin = open(0)
N = int(stdin.readline())
S = stdin.read().split()
counter = Counter(S)
max_cnt = max(counter.values())
names = [name for name, cnt in counter.items() if cnt == max_cnt]
names.sort()
print(*names, sep="\n")

-n = int(eval(input())) -s = [eval(input()) for _ in range(n)] -d = {} -for w in s: -    if w not in d: -        d[w] = 0 -    d[w] += 1 -d2 = sorted(list(d.items()), key=lambda x: x[1], reverse=True) -maxcnts = [w[0] for w in d2 if w[1] == d2[0][1]] -maxcnts.sort() -for ans in maxcnts: -    print(ans) +from collections import Counter + +stdin = open(0) +N = int(stdin.readline()) +S = stdin.read().split() +counter = Counter(S) +max_cnt = max(counter.values()) +names = [name for name, cnt in counter.items() if cnt == max_cnt] +names.sort() +print(*names, sep="\n")