from collections import defaultdict



N = int(eval(input()))

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

A.sort()

d = defaultdict(int)

for a in A:

    d[a] += 1



l = sorted(d.items())

max_v = 0



for _, v in l:

    if v > max_v:

        max_v = v

    

for k, v in l:

    if v == max_v:

        print(k)

    else:

        continue

from collections import defaultdict



def solve():

    N = int(eval(input()))

    d = defaultdict(int)

    for _ in range(N):

        a = eval(input())

        d[a] += 1



    m = 0

    for k, v in list(d.items()):

        m = max(m, v)

    

    l = []

    for k, v in list(d.items()):

        if m == v:

            l.append(k)

    l.sort()

    for ans in l:

        print(ans)

    

solve()
from collections import defaultdict

N = int(eval(input()))
A = [eval(input()) for _ in range(N)]
A.sort()
d = defaultdict(int)
for a in A:
    d[a] += 1
l = sorted(d.items())
max_v = 0
for _, v in l:
    if v > max_v:
        max_v = v
for k, v in l:
    if v == max_v:
        print(k)
    else:
        continue

from collections import defaultdict


def solve():
    N = int(eval(input()))
    d = defaultdict(int)
    for _ in range(N):
        a = eval(input())
        d[a] += 1
    m = 0
    for k, v in list(d.items()):
        m = max(m, v)
    l = []
    for k, v in list(d.items()):
        if m == v:
            l.append(k)
    l.sort()
    for ans in l:
        print(ans)


solve()

-N = int(eval(input())) -A = [eval(input()) for _ in range(N)] -A.sort() -d = defaultdict(int) -for a in A: -    d[a] += 1 -l = sorted(d.items()) -max_v = 0 -for _, v in l: -    if v > max_v: -        max_v = v -for k, v in l: -    if v == max_v: -        print(k) -    else: -        continue + +def solve(): +    N = int(eval(input())) +    d = defaultdict(int) +    for _ in range(N): +        a = eval(input()) +        d[a] += 1 +    m = 0 +    for k, v in list(d.items()): +        m = max(m, v) +    l = [] +    for k, v in list(d.items()): +        if m == v: +            l.append(k) +    l.sort() +    for ans in l: +        print(ans) + + +solve()