n = int(eval(input()))



dic = {}



for i in range(n):

    s = eval(input())

    if s in dic:

        dic[s] += 1

    else:

        dic[s] = 1



d = max(dic.values())

max_k_list = [kv[0] for kv in list(dic.items()) if kv[1] == d]

max_k_list.sort()



for s in max_k_list:

    print(s)

import collections

n=int(eval(input()))

s=[]

for i in range(n):

    s.append(eval(input()))

c=collections.Counter(s).most_common()



ans=[c[0][0]]

mx=c[0][1]

for i in range(1,len(c)):

    if c[i][1]==mx:

        ans.append(c[i][0])

    else:

        break



ans.sort()

for res in ans:

    print(res)

    
n = int(eval(input()))
dic = {}
for i in range(n):
    s = eval(input())
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
d = max(dic.values())
max_k_list = [kv[0] for kv in list(dic.items()) if kv[1] == d]
max_k_list.sort()
for s in max_k_list:
    print(s)

import collections

n = int(eval(input()))
s = []
for i in range(n):
    s.append(eval(input()))
c = collections.Counter(s).most_common()
ans = [c[0][0]]
mx = c[0][1]
for i in range(1, len(c)):
    if c[i][1] == mx:
        ans.append(c[i][0])
    else:
        break
ans.sort()
for res in ans:
    print(res)

+import collections + -dic = {} +s = [] -    s = eval(input()) -    if s in dic: -        dic[s] += 1 +    s.append(eval(input())) +c = collections.Counter(s).most_common() +ans = [c[0][0]] +mx = c[0][1] +for i in range(1, len(c)): +    if c[i][1] == mx: +        ans.append(c[i][0]) -        dic[s] = 1 -d = max(dic.values()) -max_k_list = [kv[0] for kv in list(dic.items()) if kv[1] == d] -max_k_list.sort() -for s in max_k_list: -    print(s) +        break +ans.sort() +for res in ans: +    print(res)