import collections
n = int(input())
dic = collections.defaultdict(int)
for _ in range(n):
    s = input()
    dic[s] +=1
sorted_dic = sorted(dic.items(), key = lambda x:(-x[1],x[0]))
val = sorted_dic[0][1]
for k,v in sorted_dic:
    if v==val:
        print(k) import collections collections n = int(input()) n int(input()) int input() input dic = collections.defaultdict(int) dic collections.defaultdict(int) collections.defaultdict collections defaultdict int for _ in range(n):
    s = input()
    dic[s] +=1 _ range(n) range n s = input() s input() input dic[s] +=1 dic[s] dic s 1 sorted_dic = sorted(dic.items(), key = lambda x:(-x[1],x[0])) sorted_dic sorted(dic.items(), key = lambda x:(-x[1],x[0])) sorted dic.items() dic.items dic 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 val = sorted_dic[0][1] val sorted_dic[0][1] [0] sorted_dic 0 1 for k,v in sorted_dic:
    if v==val:
        print(k) k v sorted_dic if v==val:
        print(k) v==val v val print(k) print k dic = collections.defaultdict(int) collections.defaultdict(int) dic sorted_dic = sorted(dic.items(), key = lambda x:(-x[1],x[0])) sorted(dic.items(), key = lambda x:(-x[1],x[0])) sorted_dic s = input() input() s val = sorted_dic[0][1] sorted_dic[0][1] val n = int(input()) int(input()) n
import collections
n = int(input())
dic = collections.defaultdict(int)
for _ in range(n):
    s = input()
    dic[s] +=1
sorted_dic = sorted(dic.items(), key = lambda x:(-x[1],x[0]))
val = sorted_dic[0][1]
for k,v in sorted_dic:
    if v==val:
        print(k)
