from sys import stdin

n=int(stdin.readline().rstrip())

#print(n)

dic={}

for i in range(n):

    s=stdin.readline().rstrip()

    if s in list(dic.keys()):

        dic[s] +=1

    else:

        dic[s]=1

#print(dic)

#print(dic.keys())

sup=0

suc=[]

for (i,number) in list(dic.items()):

    if number>sup:

        suc=[]

        sup=number

        suc.append(i)

    elif number==sup:

        suc.append(i)

for k in (sorted(suc)):

    print(k)
# coding: utf-8

# hello worldと表示する

#float型を許すな

#numpyはpythonで

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10**7)

from collections import Counter, deque

from collections import defaultdict

from itertools import combinations, permutations, accumulate, groupby, product

from bisect import bisect_left,bisect_right

from heapq import heapify, heappop, heappush

from math import floor, ceil,pi,factorial

from operator import itemgetter

def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))

def LI2(): return [int(eval(input())) for i in range(n)]

def MXI(): return [[LI()]for i in range(n)]

def SI(): return input().rstrip()

def printns(x): print(('\n'.join(x)))

def printni(x): print(('\n'.join(list(map(str,x)))))

inf = 10**17

mod = 10**9 + 7



n=I()

lis=[SI() for i in range(n)]

c=Counter(lis)

mx=0

for x in list(c.keys()):

    if c[x]>mx:

        mx=c[x]

answers=[]

for x in list(c.keys()):

    if c[x]==mx:

        answers.append(x)

answers.sort()

for x in answers:

    print(x)
from sys import stdin

n = int(stdin.readline().rstrip())
# print(n)
dic = {}
for i in range(n):
    s = stdin.readline().rstrip()
    if s in list(dic.keys()):
        dic[s] += 1
    else:
        dic[s] = 1
# print(dic)
# print(dic.keys())
sup = 0
suc = []
for (i, number) in list(dic.items()):
    if number > sup:
        suc = []
        sup = number
        suc.append(i)
    elif number == sup:
        suc.append(i)
for k in sorted(suc):
    print(k)

# coding: utf-8
# hello worldと表示する
# float型を許すな
# numpyはpythonで
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left, bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil, pi, factorial
from operator import itemgetter


def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def LI2():
    return [int(eval(input())) for i in range(n)]


def MXI():
    return [[LI()] for i in range(n)]


def SI():
    return input().rstrip()


def printns(x):
    print(("\n".join(x)))


def printni(x):
    print(("\n".join(list(map(str, x)))))


inf = 10**17
mod = 10**9 + 7
n = I()
lis = [SI() for i in range(n)]
c = Counter(lis)
mx = 0
for x in list(c.keys()):
    if c[x] > mx:
        mx = c[x]
answers = []
for x in list(c.keys()):
    if c[x] == mx:
        answers.append(x)
answers.sort()
for x in answers:
    print(x)

-from sys import stdin +# coding: utf-8 +# hello worldと表示する +# float型を許すな +# numpyはpythonで +import sys -n = int(stdin.readline().rstrip()) -# print(n) -dic = {} -for i in range(n): -    s = stdin.readline().rstrip() -    if s in list(dic.keys()): -        dic[s] += 1 -    else: -        dic[s] = 1 -# print(dic) -# print(dic.keys()) -sup = 0 -suc = [] -for (i, number) in list(dic.items()): -    if number > sup: -        suc = [] -        sup = number -        suc.append(i) -    elif number == sup: -        suc.append(i) -for k in sorted(suc): -    print(k) +input = sys.stdin.readline +sys.setrecursionlimit(10**7) +from collections import Counter, deque +from collections import defaultdict +from itertools import combinations, permutations, accumulate, groupby, product +from bisect import bisect_left, bisect_right +from heapq import heapify, heappop, heappush +from math import floor, ceil, pi, factorial +from operator import itemgetter + + +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def LI2(): +    return [int(eval(input())) for i in range(n)] + + +def MXI(): +    return [[LI()] for i in range(n)] + + +def SI(): +    return input().rstrip() + + +def printns(x): +    print(("\n".join(x))) + + +def printni(x): +    print(("\n".join(list(map(str, x))))) + + +inf = 10**17 +mod = 10**9 + 7 +n = I() +lis = [SI() for i in range(n)] +c = Counter(lis) +mx = 0 +for x in list(c.keys()): +    if c[x] > mx: +        mx = c[x] +answers = [] +for x in list(c.keys()): +    if c[x] == mx: +        answers.append(x) +answers.sort() +for x in answers: +    print(x)