from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations,permutations
from copy import deepcopy
import sys
sys.setrecursionlimit(4100000)



if __name__ == '__main__':
    N = int(input())
    S_list = []

    s_hash = dict()

    for i in range(N):
        S_list.append(input())

    for s in S_list:
        if s not in s_hash:
            s_hash[s] = 1
        else:
            s_hash[s] += 1
    max_p = 0
    max_p_name = []
    for k, v in s_hash.items():
        if max_p < v:
            max_p_name = []
            max_p = v
        if max_p == v:
            max_p_name.append(k)
    
    for p in sorted(max_p_name):
        print(p) from fractions import gcd from collections import Counter, deque, defaultdict from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort from itertools import product, combinations,permutations from copy import deepcopy import sys sys sys.setrecursionlimit(4100000) sys.setrecursionlimit sys setrecursionlimit 4100000 if __name__ == '__main__':
    N = int(input())
    S_list = []

    s_hash = dict()

    for i in range(N):
        S_list.append(input())

    for s in S_list:
        if s not in s_hash:
            s_hash[s] = 1
        else:
            s_hash[s] += 1
    max_p = 0
    max_p_name = []
    for k, v in s_hash.items():
        if max_p < v:
            max_p_name = []
            max_p = v
        if max_p == v:
            max_p_name.append(k)
    
    for p in sorted(max_p_name):
        print(p) __name__ == '__main__' __name__ '__main__' N = int(input()) N int(input()) int input() input S_list = [] S_list [] s_hash = dict() s_hash dict() dict for i in range(N):
        S_list.append(input())

     i range(N) range N S_list.append(input()) S_list.append S_list append input() input for s in S_list:
        if s not in s_hash:
            s_hash[s] = 1
        else:
            s_hash[s] += 1
     s S_list if s not in s_hash:
            s_hash[s] = 1
        else:
            s_hash[s] += 1
     s not in s_hash s s_hash s_hash[s] = 1 s_hash[s] s_hash s 1 s_hash[s] += 1 s_hash[s] s_hash s 1 max_p = 0 max_p 0 max_p_name = [] max_p_name [] for k, v in s_hash.items():
        if max_p < v:
            max_p_name = []
            max_p = v
        if max_p == v:
            max_p_name.append(k)
    
     k v s_hash.items() s_hash.items s_hash items if max_p < v:
            max_p_name = []
            max_p = v
         max_p < v max_p v max_p_name = [] max_p_name [] max_p = v max_p v if max_p == v:
            max_p_name.append(k)
    
     max_p == v max_p v max_p_name.append(k) max_p_name.append max_p_name append k for p in sorted(max_p_name):
        print(p) p sorted(max_p_name) sorted max_p_name print(p) print p N = int(input()) int(input()) N max_p = v v max_p s_hash = dict() dict() s_hash max_p_name = [] [] max_p_name S_list = [] [] S_list max_p_name = [] [] max_p_name max_p = 0 0 max_p
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations,permutations
from copy import deepcopy
import sys
sys.setrecursionlimit(4100000)



if __name__ == '__main__':
    N = int(input())
    S_list = []

    s_hash = dict()

    for i in range(N):
        S_list.append(input())

    for s in S_list:
        if s not in s_hash:
            s_hash[s] = 1
        else:
            s_hash[s] += 1
    max_p = 0
    max_p_name = []
    for k, v in s_hash.items():
        if max_p < v:
            max_p_name = []
            max_p = v
        if max_p == v:
            max_p_name.append(k)
    
    for p in sorted(max_p_name):
        print(p)