from collections import defaultdict
n = int(input())
dic = defaultdict(int)
for i in range(n):
    dic[input()] += 1
tmp = [(key, value) for key, value in dic.items()]
tmp.sort(key=lambda x: (x[1], x[0]))
m = tmp[-1][1]
for i in range(len(dic)):
    if tmp[i][1] == m:
        print (tmp[i][0]) from collections import defaultdict n = int(input()) n int(input()) int input() input dic = defaultdict(int) dic defaultdict(int) defaultdict int for i in range(n):
    dic[input()] += 1 i range(n) range n dic[input()] += 1 dic[input()] dic input() input 1 (key, value) for key, value in dic.items() for key, value in dic.items() key value dic.items() dic.items dic items for key, value in dic.items() (key, value) key value tmp = [(key, value) for key, value in dic.items()] tmp [(key, value) for key, value in dic.items()] tmp.sort(key=lambda x: (x[1], x[0])) tmp.sort tmp sort key=lambda x: (x[1], x[0]) key lambda x: (x[1], x[0]) (x[1], x[0]) x[1] x 1 x[0] x 0 x m = tmp[-1][1] m tmp[-1][1] [-1] tmp -1 1 for i in range(len(dic)):
    if tmp[i][1] == m:
        print (tmp[i][0]) i range(len(dic)) range len(dic) len dic if tmp[i][1] == m:
        print (tmp[i][0]) tmp[i][1] == m tmp[i][1] [i] tmp i 1 m print (tmp[i][0]) print tmp[i][0] [i] tmp i 0 n = int(input()) int(input()) n dic = defaultdict(int) defaultdict(int) dic m = tmp[-1][1] tmp[-1][1] m tmp = [(key, value) for key, value in dic.items()] [(key, value) for key, value in dic.items()] tmp
from collections import defaultdict
n = int(input())
dic = defaultdict(int)
for i in range(n):
    dic[input()] += 1
tmp = [(key, value) for key, value in dic.items()]
tmp.sort(key=lambda x: (x[1], x[0]))
m = tmp[-1][1]
for i in range(len(dic)):
    if tmp[i][1] == m:
        print (tmp[i][0])