import math
import statistics
import collections
a=int(input())
#b,c=int(input()),int(input())
# c=[]
#  for i in b:
#     c.append(i)
#e1,e2 = map(int,input().split())
# f = list(map(int,input().split()))
g = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))

g.sort()

ma=0
count=1
#最大値求める
for i in range(a-1):
    if g[i]==g[i+1]:
        count+=1
    else:
        ma=max(ma,count)
        count=1

ma=max(ma,count)
count=1
ans=[]
#最大値の位置
for i in range(a-1):
    if g[i]==g[i+1]:
        count+=1
    else:
        if count==ma:
            ans.append(g[i])
        count=1
if count==ma:
    ans.append(g[-1])

for i in ans:
    print(i) import math math import statistics statistics import collections collections a=int(input()) a int(input()) int input() input input() for _ in range(a) for _ in range(a) _ range(a) range a for _ in range(a) input() input g = [input() for _ in range(a)] g [input() for _ in range(a)] g.sort() g.sort g sort ma=0 ma 0 count=1 count 1 for i in range(a-1):
    if g[i]==g[i+1]:
        count+=1
    else:
        ma=max(ma,count)
        count=1 i range(a-1) range a-1 a 1 if g[i]==g[i+1]:
        count+=1
    else:
        ma=max(ma,count)
        count=1 g[i]==g[i+1] g[i] g i g[i+1] g i+1 i 1 count+=1 count 1 ma=max(ma,count) ma max(ma,count) max ma count count=1 count 1 ma=max(ma,count) ma max(ma,count) max ma count count=1 count 1 ans=[] ans [] for i in range(a-1):
    if g[i]==g[i+1]:
        count+=1
    else:
        if count==ma:
            ans.append(g[i])
        count=1 i range(a-1) range a-1 a 1 if g[i]==g[i+1]:
        count+=1
    else:
        if count==ma:
            ans.append(g[i])
        count=1 g[i]==g[i+1] g[i] g i g[i+1] g i+1 i 1 count+=1 count 1 if count==ma:
            ans.append(g[i])
         count==ma count ma ans.append(g[i]) ans.append ans append g[i] g i count=1 count 1 if count==ma:
    ans.append(g[-1]) count==ma count ma ans.append(g[-1]) ans.append ans append g[-1] g -1 for i in ans:
    print(i) i ans print(i) print i a=int(input()) int(input()) a count=1 1 count count=1 1 count g = [input() for _ in range(a)] [input() for _ in range(a)] g count+=1 1 count count+=1 1 count ans=[] [] ans ma=0 0 ma count=1 1 count ma=max(ma,count) max(ma,count) ma count=1 1 count ma=max(ma,count) max(ma,count) ma
import math
import statistics
import collections
a=int(input())
#b,c=int(input()),int(input())
# c=[]
#  for i in b:
#     c.append(i)
#e1,e2 = map(int,input().split())
# f = list(map(int,input().split()))
g = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))

g.sort()

ma=0
count=1
#最大値求める
for i in range(a-1):
    if g[i]==g[i+1]:
        count+=1
    else:
        ma=max(ma,count)
        count=1

ma=max(ma,count)
count=1
ans=[]
#最大値の位置
for i in range(a-1):
    if g[i]==g[i+1]:
        count+=1
    else:
        if count==ma:
            ans.append(g[i])
        count=1
if count==ma:
    ans.append(g[-1])

for i in ans:
    print(i)
