from collections import Counter as Ct
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n=INT()
    dic=[]
    for i in range(n):
        s=STR()
        dic.append(s)
    ctd=Ct(dic)
    ctm=max(ctd.values())
    ans=[]
    for key,value in ctd.items():
        if value==ctm:
            ans.append(key)
    
    ans=sorted(ans)

    for i in ans:
        print(i)


if __name__=='__main__':
    do() from collections import Counter as Ct INT = lambda: int(input()) INT lambda: int(input()) int(input()) int input() input INTM = lambda: map(int,input().split()) INTM lambda: map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split STRM = lambda: map(str,input().split()) STRM lambda: map(str,input().split()) map(str,input().split()) map str input().split() ().split () input split STR = lambda: str(input()) STR lambda: str(input()) str(input()) str input() input LIST = lambda: list(map(int,input().split())) LIST lambda: list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split LISTS = lambda: list(map(str,input().split())) LISTS lambda: list(map(str,input().split())) list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split def do():
    n=INT()
    dic=[]
    for i in range(n):
        s=STR()
        dic.append(s)
    ctd=Ct(dic)
    ctm=max(ctd.values())
    ans=[]
    for key,value in ctd.items():
        if value==ctm:
            ans.append(key)
    
    ans=sorted(ans)

    for i in ans:
        print(i) do n=INT() n INT() INT dic=[] dic [] for i in range(n):
        s=STR()
        dic.append(s)
     i range(n) range n s=STR() s STR() STR dic.append(s) dic.append dic append s ctd=Ct(dic) ctd Ct(dic) Ct dic ctm=max(ctd.values()) ctm max(ctd.values()) max ctd.values() ctd.values ctd values ans=[] ans [] for key,value in ctd.items():
        if value==ctm:
            ans.append(key)
    
     key value ctd.items() ctd.items ctd items if value==ctm:
            ans.append(key)
    
     value==ctm value ctm ans.append(key) ans.append ans append key ans=sorted(ans) ans sorted(ans) sorted ans for i in ans:
        print(i) i ans print(i) print i if __name__=='__main__':
    do() __name__=='__main__' __name__ '__main__' do() do LISTS = lambda: list(map(str,input().split())) lambda: list(map(str,input().split())) LISTS def do():
    n=INT()
    dic=[]
    for i in range(n):
        s=STR()
        dic.append(s)
    ctd=Ct(dic)
    ctm=max(ctd.values())
    ans=[]
    for key,value in ctd.items():
        if value==ctm:
            ans.append(key)
    
    ans=sorted(ans)

    for i in ans:
        print(i) def do():
    n=INT()
    dic=[]
    for i in range(n):
        s=STR()
        dic.append(s)
    ctd=Ct(dic)
    ctm=max(ctd.values())
    ans=[]
    for key,value in ctd.items():
        if value==ctm:
            ans.append(key)
    
    ans=sorted(ans)

    for i in ans:
        print(i) do STRM = lambda: map(str,input().split()) lambda: map(str,input().split()) STRM INTM = lambda: map(int,input().split()) lambda: map(int,input().split()) INTM LIST = lambda: list(map(int,input().split())) lambda: list(map(int,input().split())) LIST STR = lambda: str(input()) lambda: str(input()) STR INT = lambda: int(input()) lambda: int(input()) INT
from collections import Counter as Ct
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n=INT()
    dic=[]
    for i in range(n):
        s=STR()
        dic.append(s)
    ctd=Ct(dic)
    ctm=max(ctd.values())
    ans=[]
    for key,value in ctd.items():
        if value==ctm:
            ans.append(key)
    
    ans=sorted(ans)

    for i in ans:
        print(i)


if __name__=='__main__':
    do()