n = int(eval(input()))

l_d = {}

max_n = 0

max_w = []

for i in range(n):

    n = str(eval(input()))

    if n in l_d:

        l_d[n] += 1

        if l_d[n] > max_n:

            max_w = []

            max_w.append(n)

            max_n = l_d[n]

        elif l_d[n] == max_n:

            max_w.append(n)

    else:

        l_d[n] = 1

        if max_n <= 1:

            max_w.append(n)

            

max_w.sort()

for j in max_w:

    print(j)
import collections



n = int(eval(input()))

l = []

for i in range(n):

    l.append(str(eval(input())))

c = collections.Counter(l)

c = c.most_common()

max_l = c[0][1]

ans = []

for i in c:

    if i[1] == max_l:

        ans.append(i[0])

    else:

        break



ans.sort()

for i in ans:

    print(i)
n = int(eval(input()))
l_d = {}
max_n = 0
max_w = []
for i in range(n):
    n = str(eval(input()))
    if n in l_d:
        l_d[n] += 1
        if l_d[n] > max_n:
            max_w = []
            max_w.append(n)
            max_n = l_d[n]
        elif l_d[n] == max_n:
            max_w.append(n)
    else:
        l_d[n] = 1
        if max_n <= 1:
            max_w.append(n)
max_w.sort()
for j in max_w:
    print(j)

import collections

n = int(eval(input()))
l = []
for i in range(n):
    l.append(str(eval(input())))
c = collections.Counter(l)
c = c.most_common()
max_l = c[0][1]
ans = []
for i in c:
    if i[1] == max_l:
        ans.append(i[0])
    else:
        break
ans.sort()
for i in ans:
    print(i)

+import collections + -l_d = {} -max_n = 0 -max_w = [] +l = [] -    n = str(eval(input())) -    if n in l_d: -        l_d[n] += 1 -        if l_d[n] > max_n: -            max_w = [] -            max_w.append(n) -            max_n = l_d[n] -        elif l_d[n] == max_n: -            max_w.append(n) +    l.append(str(eval(input()))) +c = collections.Counter(l) +c = c.most_common() +max_l = c[0][1] +ans = [] +for i in c: +    if i[1] == max_l: +        ans.append(i[0]) -        l_d[n] = 1 -        if max_n <= 1: -            max_w.append(n) -max_w.sort() -for j in max_w: -    print(j) +        break +ans.sort() +for i in ans: +    print(i)