from collections import defaultdict

n = int(eval(input()))



d = defaultdict(int)

for _ in range(n):

    key = eval(input())

    d[key] += 1



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

max_v = max(d.values())



dict_li = []

for a in dict:

    if a[1]==max_v:

        dict_li.append(a[0])



dict_li.sort()

for s in dict_li:

    print(s)

from collections import defaultdict

n = int(input())



d = defaultdict(int)

for _ in range(n):

    key = input()

    d[key] += 1



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

max_v = max(d.values())



dict_li = []

for a in dict:

    if a[1]==max_v:

        dict_li.append(a[0])



dict_li.sort()

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

from collections import defaultdict

n = int(eval(input()))
d = defaultdict(int)
for _ in range(n):
    key = eval(input())
    d[key] += 1
dict = sorted(list(d.items()), key=lambda x: x[1], reverse=True)
max_v = max(d.values())
dict_li = []
for a in dict:
    if a[1] == max_v:
        dict_li.append(a[0])
dict_li.sort()
for s in dict_li:
    print(s)

from collections import defaultdict

n = int(input())
d = defaultdict(int)
for _ in range(n):
    key = input()
    d[key] += 1
dict = sorted(d.items(), key=lambda x: x[1], reverse=True)
max_v = max(d.values())
dict_li = []
for a in dict:
    if a[1] == max_v:
        dict_li.append(a[0])
dict_li.sort()
print(*dict_li, sep="\n")

-n = int(eval(input())) +n = int(input()) -    key = eval(input()) +    key = input() -dict = sorted(list(d.items()), key=lambda x: x[1], reverse=True) +dict = sorted(d.items(), key=lambda x: x[1], reverse=True) -for s in dict_li: -    print(s) +print(*dict_li, sep="\n")