import sys

import collections

n = int(eval(input()))

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

s = sorted(s)

c = collections.Counter(s)

li = []

max_v = -1

for k,j in list(c.items()):

    li.append([k,j])

    if max_v<j:

        max_v = j

li = sorted(li)

for i in range(len(li)):

    if li[i][1] == max_v:

        print((li[i][0]))
import collections

n = int(eval(input()))

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

s.sort()

t = collections.Counter(s)

maxv = max(t.values())

li = []

for key,value in list(t.items()):

    if value == maxv:

        li.append(key)

li.sort()

for i in range(len(li)):

    print((li[i]))
import sys
import collections

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
s = sorted(s)
c = collections.Counter(s)
li = []
max_v = -1
for k, j in list(c.items()):
    li.append([k, j])
    if max_v < j:
        max_v = j
li = sorted(li)
for i in range(len(li)):
    if li[i][1] == max_v:
        print((li[i][0]))

import collections

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
s.sort()
t = collections.Counter(s)
maxv = max(t.values())
li = []
for key, value in list(t.items()):
    if value == maxv:
        li.append(key)
li.sort()
for i in range(len(li)):
    print((li[i]))

-import sys -s = sorted(s) -c = collections.Counter(s) +s.sort() +t = collections.Counter(s) +maxv = max(t.values()) -max_v = -1 -for k, j in list(c.items()): -    li.append([k, j]) -    if max_v < j: -        max_v = j -li = sorted(li) +for key, value in list(t.items()): +    if value == maxv: +        li.append(key) +li.sort() -    if li[i][1] == max_v: -        print((li[i][0])) +    print((li[i]))