N=int(input())

d={}

for i in range(N):

  tmp = input()

  if tmp in d:

    d[tmp] += 1

  else:

    d[tmp] = 1



max_v=max(d.values())

ans=list(filter(lambda x: x[1] == max_v, d.items()))

[print(i[0]) for i in sorted(ans)]

from collections import Counter



N = int(eval(input()))

S = [eval(input()) for _ in range(N)]

l = Counter(S)

MAXNUM = max(l.values())



for s in sorted(list(set(S))):

    if l[s] == MAXNUM:

        print(s)
N = int(input())
d = {}
for i in range(N):
    tmp = input()
    if tmp in d:
        d[tmp] += 1
    else:
        d[tmp] = 1
max_v = max(d.values())
ans = list(filter(lambda x: x[1] == max_v, d.items()))
[print(i[0]) for i in sorted(ans)]

from collections import Counter

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
l = Counter(S)
MAXNUM = max(l.values())
for s in sorted(list(set(S))):
    if l[s] == MAXNUM:
        print(s)

-N = int(input()) -d = {} -for i in range(N): -    tmp = input() -    if tmp in d: -        d[tmp] += 1 -    else: -        d[tmp] = 1 -max_v = max(d.values()) -ans = list(filter(lambda x: x[1] == max_v, d.items())) -[print(i[0]) for i in sorted(ans)] +from collections import Counter + +N = int(eval(input())) +S = [eval(input()) for _ in range(N)] +l = Counter(S) +MAXNUM = max(l.values()) +for s in sorted(list(set(S))): +    if l[s] == MAXNUM: +        print(s)