from collections import defaultdict

from operator import itemgetter



n = int(eval(input()))



s_dict = defaultdict(int)

for _ in range(n):

    s = eval(input())

    s_dict[s] += 1



def multisort(xs, specs):

    for key, reverse in reversed(specs):

        xs.sort(key=itemgetter(key), reverse=reverse)

    return xs



s_list = multisort(list(s_dict.items()), ((1, True), (0, False)))

count_max = s_list[0][1]

for s, count in s_list:

    if count < count_max:

        break

    print(s)
from collections import defaultdict

n = int(eval(input()))

s_dict = defaultdict(int)

for _ in range(n):

    s_dict[eval(input())] += 1

count_max = sorted(s_dict.values())[-1]

s_list = sorted([s for s, count in list(s_dict.items()) if count == count_max])

for s in s_list:

    print(s)
from collections import defaultdict
from operator import itemgetter

n = int(eval(input()))
s_dict = defaultdict(int)
for _ in range(n):
    s = eval(input())
    s_dict[s] += 1


def multisort(xs, specs):
    for key, reverse in reversed(specs):
        xs.sort(key=itemgetter(key), reverse=reverse)
    return xs


s_list = multisort(list(s_dict.items()), ((1, True), (0, False)))
count_max = s_list[0][1]
for s, count in s_list:
    if count < count_max:
        break
    print(s)

from collections import defaultdict

n = int(eval(input()))
s_dict = defaultdict(int)
for _ in range(n):
    s_dict[eval(input())] += 1
count_max = sorted(s_dict.values())[-1]
s_list = sorted([s for s, count in list(s_dict.items()) if count == count_max])
for s in s_list:
    print(s)

-from operator import itemgetter -    s = eval(input()) -    s_dict[s] += 1 - - -def multisort(xs, specs): -    for key, reverse in reversed(specs): -        xs.sort(key=itemgetter(key), reverse=reverse) -    return xs - - -s_list = multisort(list(s_dict.items()), ((1, True), (0, False))) -count_max = s_list[0][1] -for s, count in s_list: -    if count < count_max: -        break +    s_dict[eval(input())] += 1 +count_max = sorted(s_dict.values())[-1] +s_list = sorted([s for s, count in list(s_dict.items()) if count == count_max]) +for s in s_list: