N=eval(input())

n=int(N)



p=[]

for i in range(n):

    p.append(eval(input()))



ha = {}



for i in p :

    if (i not in list(ha.keys())) :

        ha[i] = 1

    else :

        ha[i] += 1



res = list(ha.items())



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



i = 1

k = res[0][1]



while (i < len(res) and res[i][1] == k) :

    i += 1



res = res[ : i]



res.sort()

for i in res :

    print((i[0]))

'''



                            Online Python Compiler.

                Code, Compile, Run and Debug python program online.

Write your code in this editor and press "Run" button to execute it.



'''

from sys import stdin

def read():

    return stdin.readline().strip()



dict={}

output=[]



iteration=int(read())



max_val=-1



for _ in range(iteration):

    item=read()

    

    if dict.get(item) is None:

        dict[item]=0 

    dict[item]+=1 

    max_val = max(dict[item],max_val)

#max_val=max(dict.values())

for k,v in list(dict.items()):

    

    if(max_val==v):

        output.append(k)

    

    

output.sort()

print(('\n'.join(output)))

N = eval(input())
n = int(N)
p = []
for i in range(n):
    p.append(eval(input()))
ha = {}
for i in p:
    if i not in list(ha.keys()):
        ha[i] = 1
    else:
        ha[i] += 1
res = list(ha.items())
res = sorted(list(ha.items()), key=lambda x: x[1], reverse=True)
i = 1
k = res[0][1]
while i < len(res) and res[i][1] == k:
    i += 1
res = res[:i]
res.sort()
for i in res:
    print((i[0]))

"""
                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.
"""
from sys import stdin


def read():
    return stdin.readline().strip()


dict = {}
output = []
iteration = int(read())
max_val = -1
for _ in range(iteration):
    item = read()
    if dict.get(item) is None:
        dict[item] = 0
    dict[item] += 1
    max_val = max(dict[item], max_val)
# max_val=max(dict.values())
for k, v in list(dict.items()):
    if max_val == v:
        output.append(k)
output.sort()
print(("\n".join(output)))

-N = eval(input()) -n = int(N) -p = [] -for i in range(n): -    p.append(eval(input())) -ha = {} -for i in p: -    if i not in list(ha.keys()): -        ha[i] = 1 -    else: -        ha[i] += 1 -res = list(ha.items()) -res = sorted(list(ha.items()), key=lambda x: x[1], reverse=True) -i = 1 -k = res[0][1] -while i < len(res) and res[i][1] == k: -    i += 1 -res = res[:i] -res.sort() -for i in res: -    print((i[0])) +""" +                            Online Python Compiler. +                Code, Compile, Run and Debug python program online. +Write your code in this editor and press "Run" button to execute it. +""" +from sys import stdin + + +def read(): +    return stdin.readline().strip() + + +dict = {} +output = [] +iteration = int(read()) +max_val = -1 +for _ in range(iteration): +    item = read() +    if dict.get(item) is None: +        dict[item] = 0 +    dict[item] += 1 +    max_val = max(dict[item], max_val) +# max_val=max(dict.values()) +for k, v in list(dict.items()): +    if max_val == v: +        output.append(k) +output.sort() +print(("\n".join(output)))