import collections



n = int(eval(input()))

s_list = [eval(input()) for _ in range(n)]

s_cnt = collections.Counter(s_list)

s_sorted = s_cnt.most_common()

ans_list = [s[0] for s in s_sorted if s[1] == s_sorted[0][1]]

ans_list.sort()

for ans in ans_list:

    print(ans)
from collections import Counter



n, *s = open(0).read().split()



c = Counter(s)

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

candidates = []

for tpl in c.most_common():

    if tpl[1] == max_poll:

        candidates.append(tpl[0])



candidates.sort()



for candidate in candidates:

    print(candidate)
import collections

n = int(eval(input()))
s_list = [eval(input()) for _ in range(n)]
s_cnt = collections.Counter(s_list)
s_sorted = s_cnt.most_common()
ans_list = [s[0] for s in s_sorted if s[1] == s_sorted[0][1]]
ans_list.sort()
for ans in ans_list:
    print(ans)

from collections import Counter

n, *s = open(0).read().split()
c = Counter(s)
max_poll = c.most_common()[0][1]
candidates = []
for tpl in c.most_common():
    if tpl[1] == max_poll:
        candidates.append(tpl[0])
candidates.sort()
for candidate in candidates:
    print(candidate)

-import collections +from collections import Counter -n = int(eval(input())) -s_list = [eval(input()) for _ in range(n)] -s_cnt = collections.Counter(s_list) -s_sorted = s_cnt.most_common() -ans_list = [s[0] for s in s_sorted if s[1] == s_sorted[0][1]] -ans_list.sort() -for ans in ans_list: -    print(ans) +n, *s = open(0).read().split() +c = Counter(s) +max_poll = c.most_common()[0][1] +candidates = [] +for tpl in c.most_common(): +    if tpl[1] == max_poll: +        candidates.append(tpl[0]) +candidates.sort() +for candidate in candidates: +    print(candidate)