N = int(eval(input()))

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

import collections

max = max(collections.Counter(S).values())

letter = [a for a , b in collections.Counter(S).most_common() if b == max]

for a in sorted(letter):

    print(a)
N = int(eval(input()))

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

import collections

c = collections.Counter(S)

A = sorted(list(c.items()), key=lambda x: x[1], reverse=True)

count = 0

B = []

for a, b in A:

    if b >= count:

        B.append(a)

        count = b

    else:

        break



C = sorted(B)

for a in C:

    print(a)
N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
import collections

max = max(collections.Counter(S).values())
letter = [a for a, b in collections.Counter(S).most_common() if b == max]
for a in sorted(letter):
    print(a)

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

c = collections.Counter(S)
A = sorted(list(c.items()), key=lambda x: x[1], reverse=True)
count = 0
B = []
for a, b in A:
    if b >= count:
        B.append(a)
        count = b
    else:
        break
C = sorted(B)
for a in C:
    print(a)

-max = max(collections.Counter(S).values()) -letter = [a for a, b in collections.Counter(S).most_common() if b == max] -for a in sorted(letter): +c = collections.Counter(S) +A = sorted(list(c.items()), key=lambda x: x[1], reverse=True) +count = 0 +B = [] +for a, b in A: +    if b >= count: +        B.append(a) +        count = b +    else: +        break +C = sorted(B) +for a in C: