from collections import Counter

def resolve():

    n=int(eval(input()))

    l=[eval(input()) for i in range(n)]

    c=Counter(l)

    maxl=[]

    cntmax=max(c.values())

    for name,kazu in list(c.items()):

        if kazu==cntmax:

            maxl.append(name)

    maxl.sort()

    for i in maxl:

        print(i)

resolve()
import sys

def input(): return sys.stdin.readline().strip()



def resolve():

    n=int(eval(input()))

    l=[eval(input()) for i in range(n)]

    from collections import Counter

    c=Counter(l)

    csort=c.most_common()

    maxl=[]

    for i in range(len(csort)):

        if csort[i][1]==csort[0][1]:

            maxl.append(csort[i][0])

    maxl.sort()

    for i in maxl:

        print(i)

resolve()
from collections import Counter


def resolve():
    n = int(eval(input()))
    l = [eval(input()) for i in range(n)]
    c = Counter(l)
    maxl = []
    cntmax = max(c.values())
    for name, kazu in list(c.items()):
        if kazu == cntmax:
            maxl.append(name)
    maxl.sort()
    for i in maxl:
        print(i)


resolve()

import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    n = int(eval(input()))
    l = [eval(input()) for i in range(n)]
    from collections import Counter

    c = Counter(l)
    csort = c.most_common()
    maxl = []
    for i in range(len(csort)):
        if csort[i][1] == csort[0][1]:
            maxl.append(csort[i][0])
    maxl.sort()
    for i in maxl:
        print(i)


resolve()

-from collections import Counter +import sys + + +def input(): +    return sys.stdin.readline().strip() +    from collections import Counter + +    csort = c.most_common() -    cntmax = max(c.values()) -    for name, kazu in list(c.items()): -        if kazu == cntmax: -            maxl.append(name) +    for i in range(len(csort)): +        if csort[i][1] == csort[0][1]: +            maxl.append(csort[i][0])