#10e5程度ならソートしてもTLEならないらしい？

n = int(eval(input()))

dic = {}

lis = []

lis2 = []



for i in range(n):

  moji = eval(input())

  if moji not in dic:

    dic[moji] = 0

  dic[moji] += 1

  

for i in sorted(list(dic.items()), key=lambda x:x[1]):

    lis.append(i)

  

lis.reverse()



for j in lis:

  if lis[0][1] == j[1]:

    lis2.append(j[0])

  else:

    break



lis2.sort()

for i in range(len(lis2)):

  print((lis2[i]))
#参考

def resolve():

    n=int(eval(input()))

    dic={}

    for _ in range(n):

        s=eval(input())

        if not s in list(dic.keys()):

            dic[s]=0

        else:

            dic[s]+=1

    m=max(dic.values())

    ans=[]

    for each in list(dic.keys()):

        if dic[each]==m:

            ans.append(each)

    for each in sorted(ans):

        print(each)

resolve()

# 10e5程度ならソートしてもTLEならないらしい？
n = int(eval(input()))
dic = {}
lis = []
lis2 = []
for i in range(n):
    moji = eval(input())
    if moji not in dic:
        dic[moji] = 0
    dic[moji] += 1
for i in sorted(list(dic.items()), key=lambda x: x[1]):
    lis.append(i)
lis.reverse()
for j in lis:
    if lis[0][1] == j[1]:
        lis2.append(j[0])
    else:
        break
lis2.sort()
for i in range(len(lis2)):
    print((lis2[i]))

# 参考
def resolve():
    n = int(eval(input()))
    dic = {}
    for _ in range(n):
        s = eval(input())
        if not s in list(dic.keys()):
            dic[s] = 0
        else:
            dic[s] += 1
    m = max(dic.values())
    ans = []
    for each in list(dic.keys()):
        if dic[each] == m:
            ans.append(each)
    for each in sorted(ans):
        print(each)


resolve()

-# 10e5程度ならソートしてもTLEならないらしい？ -n = int(eval(input())) -dic = {} -lis = [] -lis2 = [] -for i in range(n): -    moji = eval(input()) -    if moji not in dic: -        dic[moji] = 0 -    dic[moji] += 1 -for i in sorted(list(dic.items()), key=lambda x: x[1]): -    lis.append(i) -lis.reverse() -for j in lis: -    if lis[0][1] == j[1]: -        lis2.append(j[0]) -    else: -        break -lis2.sort() -for i in range(len(lis2)): -    print((lis2[i])) +# 参考 +def resolve(): +    n = int(eval(input())) +    dic = {} +    for _ in range(n): +        s = eval(input()) +        if not s in list(dic.keys()): +            dic[s] = 0 +        else: +            dic[s] += 1 +    m = max(dic.values()) +    ans = [] +    for each in list(dic.keys()): +        if dic[each] == m: +            ans.append(each) +    for each in sorted(ans): +        print(each) + + +resolve()