from collections import Counter

n = int(input())
s = [input() for _ in range(n)]
cnt = Counter(s)
li = sorted(cnt.items(), key=lambda x: (-x[1], x[0]))
m = li[0][1]
for i in range(len(li)):
    if li[i][1] < m:
        break
    print(li[i][0]) 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)] cnt = Counter(s) cnt Counter(s) Counter s li = sorted(cnt.items(), key=lambda x: (-x[1], x[0])) li sorted(cnt.items(), key=lambda x: (-x[1], x[0])) sorted cnt.items() cnt.items cnt items key=lambda x: (-x[1], x[0]) key lambda x: (-x[1], x[0]) (-x[1], x[0]) -x[1] x[1] x 1 x[0] x 0 x m = li[0][1] m li[0][1] [0] li 0 1 for i in range(len(li)):
    if li[i][1] < m:
        break
    print(li[i][0]) i range(len(li)) range len(li) len li if li[i][1] < m:
        break
     li[i][1] < m li[i][1] [i] li i 1 m break print(li[i][0]) print li[i][0] [i] li i 0 li = sorted(cnt.items(), key=lambda x: (-x[1], x[0])) sorted(cnt.items(), key=lambda x: (-x[1], x[0])) li m = li[0][1] li[0][1] m s = [input() for _ in range(n)] [input() for _ in range(n)] s n = int(input()) int(input()) n cnt = Counter(s) Counter(s) cnt
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]
cnt = Counter(s)
li = sorted(cnt.items(), key=lambda x: (-x[1], x[0]))
m = li[0][1]
for i in range(len(li)):
    if li[i][1] < m:
        break
    print(li[i][0])
