
def I(): return int(input())
def MI(): return 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=input()
        dd[s]+=1
        M=max(M,dd[s])
        
        
    ans=[]
    for k,v in dd.items():
        if v==M:
            ans.append(k)
            
    ans.sort()
    for k in ans:
        print(k)
        
    

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

def I(): return int(input())
def MI(): return 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=input()
        dd[s]+=1
        M=max(M,dd[s])
        
        
    ans=[]
    for k,v in dd.items():
        if v==M:
            ans.append(k)
            
    ans.sort()
    for k in ans:
        print(k)
        
    

main()
