def readinput():
    n=int(input())
    sList=[]
    for _ in range(n):
        sList.append(input())
    return n,sList

def main(n,sList):
    hist={}
    for s in sList:
        if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
    hList=sorted(list(hist.items()), key=lambda x:x[1], reverse=True)
    #print(hList)
    hvalue=hList[0][1]
    ss=[]
    i=0
    while(i<len(hList) and hList[i][1]==hvalue):
        ss.append(hList[i][0])
        i+=1
    ss.sort()
    for s in ss:
        print(s)    

if __name__=='__main__':
    n,sList=readinput()
    main(n,sList) def readinput():
    n=int(input())
    sList=[]
    for _ in range(n):
        sList.append(input())
    return n,sList readinput n=int(input()) n int(input()) int input() input sList=[] sList [] for _ in range(n):
        sList.append(input())
     _ range(n) range n sList.append(input()) sList.append sList append input() input return n,sList return n,sList n sList def main(n,sList):
    hist={}
    for s in sList:
        if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
    hList=sorted(list(hist.items()), key=lambda x:x[1], reverse=True)
    #print(hList)
    hvalue=hList[0][1]
    ss=[]
    i=0
    while(i<len(hList) and hList[i][1]==hvalue):
        ss.append(hList[i][0])
        i+=1
    ss.sort()
    for s in ss:
        print(s)     main hist={} hist {} for s in sList:
        if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
     s sList if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
     s in hist.keys() s hist.keys() hist.keys hist keys hist[s]+=1 hist[s] hist s 1 hist[s]=1 hist[s] hist s 1 hList=sorted(list(hist.items()), key=lambda x:x[1], reverse=True) hList sorted(list(hist.items()), key=lambda x:x[1], reverse=True) sorted list(hist.items()) list hist.items() hist.items hist items key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True hvalue=hList[0][1] hvalue hList[0][1] [0] hList 0 1 ss=[] ss [] i=0 i 0 while(i<len(hList) and hList[i][1]==hvalue):
        ss.append(hList[i][0])
        i+=1
     i<len(hList) and hList[i][1]==hvalue i<len(hList) i len(hList) len hList hList[i][1]==hvalue hList[i][1] [i] hList i 1 hvalue ss.append(hList[i][0]) ss.append ss append hList[i][0] [i] hList i 0 i+=1 i 1 ss.sort() ss.sort ss sort for s in ss:
        print(s)     s ss print(s) print s n n sList sList if __name__=='__main__':
    n,sList=readinput()
    main(n,sList) __name__=='__main__' __name__ '__main__' n,sList=readinput() n readinput() readinput sList main(n,sList) main n sList n,sList=readinput() readinput() n def readinput():
    n=int(input())
    sList=[]
    for _ in range(n):
        sList.append(input())
    return n,sList def readinput():
    n=int(input())
    sList=[]
    for _ in range(n):
        sList.append(input())
    return n,sList readinput def main(n,sList):
    hist={}
    for s in sList:
        if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
    hList=sorted(list(hist.items()), key=lambda x:x[1], reverse=True)
    #print(hList)
    hvalue=hList[0][1]
    ss=[]
    i=0
    while(i<len(hList) and hList[i][1]==hvalue):
        ss.append(hList[i][0])
        i+=1
    ss.sort()
    for s in ss:
        print(s)     def main(n,sList):
    hist={}
    for s in sList:
        if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
    hList=sorted(list(hist.items()), key=lambda x:x[1], reverse=True)
    #print(hList)
    hvalue=hList[0][1]
    ss=[]
    i=0
    while(i<len(hList) and hList[i][1]==hvalue):
        ss.append(hList[i][0])
        i+=1
    ss.sort()
    for s in ss:
        print(s)     main sList=readinput() readinput() sList
def readinput():
    n=int(input())
    sList=[]
    for _ in range(n):
        sList.append(input())
    return n,sList

def main(n,sList):
    hist={}
    for s in sList:
        if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
    hList=sorted(list(hist.items()), key=lambda x:x[1], reverse=True)
    #print(hList)
    hvalue=hList[0][1]
    ss=[]
    i=0
    while(i<len(hList) and hList[i][1]==hvalue):
        ss.append(hList[i][0])
        i+=1
    ss.sort()
    for s in ss:
        print(s)    

if __name__=='__main__':
    n,sList=readinput()
    main(n,sList)
