l =[]

r=[]

n = int(input())

for i in range(n):

    l.append(input())

d={}

for i in l:

    if i in d:

        d[i]+=1

    else:

        d[i]=1

print()

m = max(d.values())

for key,value in d.items():

    if value==m:

        r.append(key)

sorted_r = sorted(r)

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

from collections import Counter

import sys

n = int(sys.stdin.readline())

sn = sys.stdin.read().split()

c = Counter(sn)

num = max(c.values())

ans = [i for i, j in list(c.items()) if j == num]

ans.sort()

print(('\n'.join(ans)))
l = []
r = []
n = int(input())
for i in range(n):
    l.append(input())
d = {}
for i in l:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
print()
m = max(d.values())
for key, value in d.items():
    if value == m:
        r.append(key)
sorted_r = sorted(r)
print(*sorted_r, sep="\n")

from collections import Counter
import sys

n = int(sys.stdin.readline())
sn = sys.stdin.read().split()
c = Counter(sn)
num = max(c.values())
ans = [i for i, j in list(c.items()) if j == num]
ans.sort()
print(("\n".join(ans)))

-l = [] -r = [] -n = int(input()) -for i in range(n): -    l.append(input()) -d = {} -for i in l: -    if i in d: -        d[i] += 1 -    else: -        d[i] = 1 -print() -m = max(d.values()) -for key, value in d.items(): -    if value == m: -        r.append(key) -sorted_r = sorted(r) -print(*sorted_r, sep="\n") +from collections import Counter +import sys + +n = int(sys.stdin.readline()) +sn = sys.stdin.read().split() +c = Counter(sn) +num = max(c.values()) +ans = [i for i, j in list(c.items()) if j == num] +ans.sort() +print(("\n".join(ans)))