

N = int(eval(input()))

C = dict()





for i in range(N):

    a = eval(input())

    if(a not in list(C.keys())):

        C[a] = 1

    else:

        val = C[a]

        C[a] = val + 1



m=0

for i in list(C.values()):

    if(i > m):

        m=i



ans = sorted(C.items())

for i  in ans:

    if(m==i[1]):

        print((i[0]))
def myAnswer(N:int,S:list) -> None:

   dic = {}

   for s in S:

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

         dic[s]+=1

      else:

         dic[s]=1

   MAX = max(dic.values())

   dic2 = sorted(dic.items())

   for key,value in dic2:

      if(MAX == value):

         print(key)

   



def modelAnswer():

   tmp=1

def main():

   N = int(eval(input()))

   S = []

   for _ in range(N):

      S.append(eval(input()))

   myAnswer(N,S[:])

if __name__ == '__main__':

   main()
N = int(eval(input()))
C = dict()
for i in range(N):
    a = eval(input())
    if a not in list(C.keys()):
        C[a] = 1
    else:
        val = C[a]
        C[a] = val + 1
m = 0
for i in list(C.values()):
    if i > m:
        m = i
ans = sorted(C.items())
for i in ans:
    if m == i[1]:
        print((i[0]))

def myAnswer(N: int, S: list) -> None:
    dic = {}
    for s in S:
        if s in list(dic.keys()):
            dic[s] += 1
        else:
            dic[s] = 1
    MAX = max(dic.values())
    dic2 = sorted(dic.items())
    for key, value in dic2:
        if MAX == value:
            print(key)


def modelAnswer():
    tmp = 1


def main():
    N = int(eval(input()))
    S = []
    for _ in range(N):
        S.append(eval(input()))
    myAnswer(N, S[:])


if __name__ == "__main__":
    main()

-N = int(eval(input())) -C = dict() -for i in range(N): -    a = eval(input()) -    if a not in list(C.keys()): -        C[a] = 1 -    else: -        val = C[a] -        C[a] = val + 1 -m = 0 -for i in list(C.values()): -    if i > m: -        m = i -ans = sorted(C.items()) -for i in ans: -    if m == i[1]: -        print((i[0])) +def myAnswer(N: int, S: list) -> None: +    dic = {} +    for s in S: +        if s in list(dic.keys()): +            dic[s] += 1 +        else: +            dic[s] = 1 +    MAX = max(dic.values()) +    dic2 = sorted(dic.items()) +    for key, value in dic2: +        if MAX == value: +            print(key) + + +def modelAnswer(): +    tmp = 1 + + +def main(): +    N = int(eval(input())) +    S = [] +    for _ in range(N): +        S.append(eval(input())) +    myAnswer(N, S[:]) + + +if __name__ == "__main__": +    main()