# ABC155 C

si = lambda: eval(input())

ni = lambda: int(eval(input()))

nm = lambda: list(map(str, input().split()))

nl = lambda: list(map(int, input().split()))

from collections import defaultdict as dd

from operator import itemgetter

n=ni()

d=dd(int)

# s=[si() for i in range(n)]

for i in range(n):

    s=eval(input())

    d[s]+=1



mv=0

for k,v in list(d.items()):

    mv=max(mv,v)

ans=set()

for k,v in list(d.items()):

    if mv==v:

        ans.add(k)

ans=list(ans)

ans.sort()

for aaa in ans:

    print(aaa)



from collections import Counter

n=int(eval(input()))

s=[eval(input()) for i in range(n)]



sc=Counter(s).most_common()

max_idx=sc[0][1]

ans=[]

for i, j in sc:

    if j==max_idx:

        ans.append(i)

ans=sorted(ans)

print((*ans))
# ABC155 C
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(str, input().split()))
nl = lambda: list(map(int, input().split()))
from collections import defaultdict as dd
from operator import itemgetter

n = ni()
d = dd(int)
# s=[si() for i in range(n)]
for i in range(n):
    s = eval(input())
    d[s] += 1
mv = 0
for k, v in list(d.items()):
    mv = max(mv, v)
ans = set()
for k, v in list(d.items()):
    if mv == v:
        ans.add(k)
ans = list(ans)
ans.sort()
for aaa in ans:
    print(aaa)

from collections import Counter

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
sc = Counter(s).most_common()
max_idx = sc[0][1]
ans = []
for i, j in sc:
    if j == max_idx:
        ans.append(i)
ans = sorted(ans)
print((*ans))

-# ABC155 C -si = lambda: eval(input()) -ni = lambda: int(eval(input())) -nm = lambda: list(map(str, input().split())) -nl = lambda: list(map(int, input().split())) -from collections import defaultdict as dd -from operator import itemgetter +from collections import Counter -n = ni() -d = dd(int) -# s=[si() for i in range(n)] -for i in range(n): -    s = eval(input()) -    d[s] += 1 -mv = 0 -for k, v in list(d.items()): -    mv = max(mv, v) -ans = set() -for k, v in list(d.items()): -    if mv == v: -        ans.add(k) -ans = list(ans) -ans.sort() -for aaa in ans: -    print(aaa) +n = int(eval(input())) +s = [eval(input()) for i in range(n)] +sc = Counter(s).most_common() +max_idx = sc[0][1] +ans = [] +for i, j in sc: +    if j == max_idx: +        ans.append(i) +ans = sorted(ans) +print((*ans))