from collections import defaultdict

dd = defaultdict(int)



ma=0



N=int(eval(input()))

for i in range(N):

    S=eval(input())

    dd[S]+=1

    if dd[S]>ma:

        ma=dd[S]

       

    

ans=[]   

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

    if v==ma:

        ans.append(k)

        

ans.sort()



for i in range(len(ans)):

    print((ans[i]))









def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    from collections import defaultdict

    dd = defaultdict(int)

    

    N=I()

    M=0

    for i in range(N):

        s=eval(input())

        dd[s]+=1

        M=max(M,dd[s])

        

        

    ans=[]

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

        if v==M:

            ans.append(k)

            

    ans.sort()

    for k in ans:

        print(k)

        

    



main()

from collections import defaultdict

dd = defaultdict(int)
ma = 0
N = int(eval(input()))
for i in range(N):
    S = eval(input())
    dd[S] += 1
    if dd[S] > ma:
        ma = dd[S]
ans = []
for k, v in list(dd.items()):
    if v == ma:
        ans.append(k)
ans.sort()
for i in range(len(ans)):
    print((ans[i]))

def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    from collections import defaultdict

    dd = defaultdict(int)
    N = I()
    M = 0
    for i in range(N):
        s = eval(input())
        dd[s] += 1
        M = max(M, dd[s])
    ans = []
    for k, v in list(dd.items()):
        if v == M:
            ans.append(k)
    ans.sort()
    for k in ans:
        print(k)


main()

-from collections import defaultdict +def I(): +    return int(eval(input())) -dd = defaultdict(int) -ma = 0 -N = int(eval(input())) -for i in range(N): -    S = eval(input()) -    dd[S] += 1 -    if dd[S] > ma: -        ma = dd[S] -ans = [] -for k, v in list(dd.items()): -    if v == ma: -        ans.append(k) -ans.sort() -for i in range(len(ans)): -    print((ans[i])) + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    from collections import defaultdict + +    dd = defaultdict(int) +    N = I() +    M = 0 +    for i in range(N): +        s = eval(input()) +        dd[s] += 1 +        M = max(M, dd[s]) +    ans = [] +    for k, v in list(dd.items()): +        if v == M: +            ans.append(k) +    ans.sort() +    for k in ans: +        print(k) + + +main()