import collections



N = int(eval(input()))

A =[]

for i in range(N):

    A.append(eval(input()))

    

ans =[]

c = collections.Counter(A)

m = c.most_common()

ma = m[0][1]



for i in range(len(m)):

    if m[i][1] == ma:

        ans.append(m[i][0])

ans.sort()



for i in range(len(ans)):

    print((ans[i]))
import collections



N = int(eval(input()))

A =[]

for i in range(N):

    A.append(eval(input()))

    

ans =[]

c = collections.Counter(A)

m = c.most_common()

ma = m[0][1]



for i in range(len(m)):

    if m[i][1] == ma:

        ans.append(m[i][0])

ans.sort()



print(("\n".join(ans)))
import collections

N = int(eval(input()))
A = []
for i in range(N):
    A.append(eval(input()))
ans = []
c = collections.Counter(A)
m = c.most_common()
ma = m[0][1]
for i in range(len(m)):
    if m[i][1] == ma:
        ans.append(m[i][0])
ans.sort()
for i in range(len(ans)):
    print((ans[i]))

import collections

N = int(eval(input()))
A = []
for i in range(N):
    A.append(eval(input()))
ans = []
c = collections.Counter(A)
m = c.most_common()
ma = m[0][1]
for i in range(len(m)):
    if m[i][1] == ma:
        ans.append(m[i][0])
ans.sort()
print(("\n".join(ans)))

-for i in range(len(ans)): -    print((ans[i])) +print(("\n".join(ans)))