from collections import Counter

N = int(eval(input()))

S = [eval(input()) for _ in range(N)]

C = Counter(S)

l = []

max = C.most_common(1)[0][1]

for c in C.most_common():

    if max == c[1]:

        l.append(c[0])

    else:

        break

l.sort()

for x in l:

    print(x)
from collections import Counter

N = int(eval(input()))

S = [eval(input()) for _ in range(N)]

C = Counter(S)

l = []

max = C.most_common(1)[0][1]

for c in C.most_common():

    if max == c[1]:

        l.append(c[0])

    else:

        break

l.sort()

print(("\n".join(l)))
from collections import Counter

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
C = Counter(S)
l = []
max = C.most_common(1)[0][1]
for c in C.most_common():
    if max == c[1]:
        l.append(c[0])
    else:
        break
l.sort()
for x in l:
    print(x)

from collections import Counter

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
C = Counter(S)
l = []
max = C.most_common(1)[0][1]
for c in C.most_common():
    if max == c[1]:
        l.append(c[0])
    else:
        break
l.sort()
print(("\n".join(l)))

-for x in l: -    print(x) +print(("\n".join(l)))