from collections import Counter



N = int(eval(input()))

S = [0]*N

for i in range(N):

  S[i] = eval(input())  

S.sort()

c = Counter(S)

m_num = c.most_common()[0][1]



for s in sorted(list(set(S))):

  if c[s] == m_num:

    print(s)
from collections import defaultdict



N = int(eval(input()))

sdict = defaultdict(int)

for i in range(N):

  sdict[eval(input())] += 1



mx = 0

for key, val in list(sdict.items()):

  mx = max(mx, val)



ls = []

for key, val in list(sdict.items()):

  if val == mx:

    ls.append(key)



ls.sort()

for s in ls:

  print(s)
from collections import Counter

N = int(eval(input()))
S = [0] * N
for i in range(N):
    S[i] = eval(input())
S.sort()
c = Counter(S)
m_num = c.most_common()[0][1]
for s in sorted(list(set(S))):
    if c[s] == m_num:
        print(s)

from collections import defaultdict

N = int(eval(input()))
sdict = defaultdict(int)
for i in range(N):
    sdict[eval(input())] += 1
mx = 0
for key, val in list(sdict.items()):
    mx = max(mx, val)
ls = []
for key, val in list(sdict.items()):
    if val == mx:
        ls.append(key)
ls.sort()
for s in ls:
    print(s)

-from collections import Counter +from collections import defaultdict -S = [0] * N +sdict = defaultdict(int) -    S[i] = eval(input()) -S.sort() -c = Counter(S) -m_num = c.most_common()[0][1] -for s in sorted(list(set(S))): -    if c[s] == m_num: -        print(s) +    sdict[eval(input())] += 1 +mx = 0 +for key, val in list(sdict.items()): +    mx = max(mx, val) +ls = [] +for key, val in list(sdict.items()): +    if val == mx: +        ls.append(key) +ls.sort() +for s in ls: +    print(s)