import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

N = int(readline())

S = read().split()



S = sorted(S)

ls = [[] for i in range(N + 1)]

max_num = 0

left = 0

right = 0

while right < N:

    while right < N and S[left] == S[right]:

        right += 1

    if (right  - left) >= max_num:

        ls[right - left].append(S[left].decode())

        max_num = right - left

    left = right

    

print(('\n'.join(ls[max_num])))

from collections import Counter



import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

N = int(readline())

S = read().split()



res = []

c = Counter(S)

max_num = c.most_common(1)[0][1]

for i, j in list(c.items()):

    if j == max_num:

        res.append(i)

        

res.sort()



        

print(('\n'.join(list([x.decode() for x in res]))))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = read().split()
S = sorted(S)
ls = [[] for i in range(N + 1)]
max_num = 0
left = 0
right = 0
while right < N:
    while right < N and S[left] == S[right]:
        right += 1
    if (right - left) >= max_num:
        ls[right - left].append(S[left].decode())
        max_num = right - left
    left = right
print(("\n".join(ls[max_num])))

from collections import Counter
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = read().split()
res = []
c = Counter(S)
max_num = c.most_common(1)[0][1]
for i, j in list(c.items()):
    if j == max_num:
        res.append(i)
res.sort()
print(("\n".join(list([x.decode() for x in res]))))

+from collections import Counter -S = sorted(S) -ls = [[] for i in range(N + 1)] -max_num = 0 -left = 0 -right = 0 -while right < N: -    while right < N and S[left] == S[right]: -        right += 1 -    if (right - left) >= max_num: -        ls[right - left].append(S[left].decode()) -        max_num = right - left -    left = right -print(("\n".join(ls[max_num]))) +res = [] +c = Counter(S) +max_num = c.most_common(1)[0][1] +for i, j in list(c.items()): +    if j == max_num: +        res.append(i) +res.sort() +print(("\n".join(list([x.decode() for x in res]))))