from collections import Counter

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

c = Counter(s)
m = max(list(c.values()))
d = sorted(c.items(), key=lambda x: x[1], reverse=True)

t = set()
for i, j in d:
    if j == m:
        t.add(i)
    else:
        break
for i in sorted(t):
    print(i) 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 m = max(list(c.values())) m max(list(c.values())) max list(c.values()) list c.values() c.values c values d = sorted(c.items(), key=lambda x: x[1], reverse=True) d 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 t = set() t set() set for i, j in d:
    if j == m:
        t.add(i)
    else:
        break i j d if j == m:
        t.add(i)
    else:
        break j == m j m t.add(i) t.add t add i break for i in sorted(t):
    print(i) i sorted(t) sorted t print(i) print i s = [input() for _ in range(n)] [input() for _ in range(n)] s m = max(list(c.values())) max(list(c.values())) m d = sorted(c.items(), key=lambda x: x[1], reverse=True) sorted(c.items(), key=lambda x: x[1], reverse=True) d c = Counter(s) Counter(s) c t = set() set() t n = int(input()) int(input()) n
from collections import Counter

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

c = Counter(s)
m = max(list(c.values()))
d = sorted(c.items(), key=lambda x: x[1], reverse=True)

t = set()
for i, j in d:
    if j == m:
        t.add(i)
    else:
        break
for i in sorted(t):
    print(i)