from collections import Counter



n=int(eval(input()))

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



c = Counter(s)

c2 = c.most_common()

m = c2[0][1]#最大値

ans = [i[0] for i in c2 if i[1] == m]#回数が最大となるもの

ans.sort()

print((*ans))
n = int(eval(input()))

d = {}

for _ in range(n):

    s = eval(input())

    d[s] = d.get(s, 0) + 1



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

ma = sorted_d[0][1]



res = []



for i in range(len(sorted_d)):

    if sorted_d[i][1] == ma:

        res.append(sorted_d[i][0])



res.sort()



for i in range(len(res)):

    print((res[i]))
from collections import Counter

n = int(eval(input()))
s = [eval(input()) for i in range(n)]
c = Counter(s)
c2 = c.most_common()
m = c2[0][1]  # 最大値
ans = [i[0] for i in c2 if i[1] == m]  # 回数が最大となるもの
ans.sort()
print((*ans))

n = int(eval(input()))
d = {}
for _ in range(n):
    s = eval(input())
    d[s] = d.get(s, 0) + 1
sorted_d = sorted(list(d.items()), key=lambda x: x[1], reverse=True)
ma = sorted_d[0][1]
res = []
for i in range(len(sorted_d)):
    if sorted_d[i][1] == ma:
        res.append(sorted_d[i][0])
res.sort()
for i in range(len(res)):
    print((res[i]))

-from collections import Counter - -s = [eval(input()) for i in range(n)] -c = Counter(s) -c2 = c.most_common() -m = c2[0][1]  # 最大値 -ans = [i[0] for i in c2 if i[1] == m]  # 回数が最大となるもの -ans.sort() -print((*ans)) +d = {} +for _ in range(n): +    s = eval(input()) +    d[s] = d.get(s, 0) + 1 +sorted_d = sorted(list(d.items()), key=lambda x: x[1], reverse=True) +ma = sorted_d[0][1] +res = [] +for i in range(len(sorted_d)): +    if sorted_d[i][1] == ma: +        res.append(sorted_d[i][0]) +res.sort() +for i in range(len(res)): +    print((res[i]))