from collections import defaultdict

n = int(input())
l = defaultdict(int)
m = 0
for _ in range(n):
    s = input()
    l[s] += 1
    m = max(m, l[s])

ans = []
for k, v in l.items():
    if v == m:
        ans.append(k)
ans.sort()
for s in ans:
    print(s) from collections import defaultdict n = int(input()) n int(input()) int input() input l = defaultdict(int) l defaultdict(int) defaultdict int m = 0 m 0 for _ in range(n):
    s = input()
    l[s] += 1
    m = max(m, l[s]) _ range(n) range n s = input() s input() input l[s] += 1 l[s] l s 1 m = max(m, l[s]) m max(m, l[s]) max m l[s] l s ans = [] ans [] for k, v in l.items():
    if v == m:
        ans.append(k) k v l.items() l.items l 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 s in ans:
    print(s) s ans print(s) print s n = int(input()) int(input()) n s = input() input() s l = defaultdict(int) defaultdict(int) l m = 0 0 m ans = [] [] ans m = max(m, l[s]) max(m, l[s]) m
from collections import defaultdict

n = int(input())
l = defaultdict(int)
m = 0
for _ in range(n):
    s = input()
    l[s] += 1
    m = max(m, l[s])

ans = []
for k, v in l.items():
    if v == m:
        ans.append(k)
ans.sort()
for s in ans:
    print(s)
