from collections import Counter

n = int(input())

s = [input() for _ in range(n)]

c = Counter(s)

csort = sorted(c.items(), key=lambda x:x[1],reverse=True)

maxc = csort[0][1]
ans = []
for s,v in csort:
    if v == maxc:
        ans.append(s)
        
anssort = sorted(ans)

for s in anssort:
    print(s) from collections import Counter n = int(input()) n int(input()) int input() input input() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) input() input s = [input() for _ in range(n)] s [input() for _ in range(n)] c = Counter(s) c Counter(s) Counter s csort = sorted(c.items(), key=lambda x:x[1],reverse=True) csort sorted(c.items(), key=lambda x:x[1],reverse=True) sorted c.items() c.items c items key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True maxc = csort[0][1] maxc csort[0][1] [0] csort 0 1 ans = [] ans [] for s,v in csort:
    if v == maxc:
        ans.append(s)
         s v csort if v == maxc:
        ans.append(s)
         v == maxc v maxc ans.append(s) ans.append ans append s anssort = sorted(ans) anssort sorted(ans) sorted ans for s in anssort:
    print(s) s anssort print(s) print s csort = sorted(c.items(), key=lambda x:x[1],reverse=True) sorted(c.items(), key=lambda x:x[1],reverse=True) csort ans = [] [] ans n = int(input()) int(input()) n c = Counter(s) Counter(s) c maxc = csort[0][1] csort[0][1] maxc anssort = sorted(ans) sorted(ans) anssort s = [input() for _ in range(n)] [input() for _ in range(n)] s
from collections import Counter

n = int(input())

s = [input() for _ in range(n)]

c = Counter(s)

csort = sorted(c.items(), key=lambda x:x[1],reverse=True)

maxc = csort[0][1]
ans = []
for s,v in csort:
    if v == maxc:
        ans.append(s)
        
anssort = sorted(ans)

for s in anssort:
    print(s)