n=int(eval(input()))

s={}

for i in range(n):

  wd=eval(input())

  if wd in s:

    s[wd]+=1

  else:

    s[wd]=1

mx=max(s.values())



ans=[]

for i in list(s.keys()):

  if s[i]==mx:

    ans.append(i)

ans.sort()

for i in ans:

  print(i)

from collections import Counter



n=int(eval(input()))

s=[]

for i in range(n):

  a=eval(input())

  s.append(a)

c=Counter(s)



mx=max(c.values())

ans=[]

for i in c:

  if c[i]==mx:

    ans.append(i)

ans.sort()

for i in ans:

  print(i)
n = int(eval(input()))
s = {}
for i in range(n):
    wd = eval(input())
    if wd in s:
        s[wd] += 1
    else:
        s[wd] = 1
mx = max(s.values())
ans = []
for i in list(s.keys()):
    if s[i] == mx:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

from collections import Counter

n = int(eval(input()))
s = []
for i in range(n):
    a = eval(input())
    s.append(a)
c = Counter(s)
mx = max(c.values())
ans = []
for i in c:
    if c[i] == mx:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

+from collections import Counter + -s = {} +s = [] -    wd = eval(input()) -    if wd in s: -        s[wd] += 1 -    else: -        s[wd] = 1 -mx = max(s.values()) +    a = eval(input()) +    s.append(a) +c = Counter(s) +mx = max(c.values()) -for i in list(s.keys()): -    if s[i] == mx: +for i in c: +    if c[i] == mx: