from collections import  Counter

n = int(eval(input()))

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

cnt = Counter(a)

l = max(cnt.values())

ans = [s for s,c in list(cnt.items())if c ==l]

ans.sort()

print(('\n'.join(ans)))
n = int(eval(input()))

s = dict()

for i in range(n):

    si = eval(input())

    if si in s:

        s[si] +=1

    else:

        s[si] = 0

l = max(s.values())

ans = []

for i in s:

    if s[i] ==l:

        ans.append(i)

ans.sort()

for i in ans:

    print(i)
from collections import Counter

n = int(eval(input()))
a = [eval(input()) for i in range(n)]
cnt = Counter(a)
l = max(cnt.values())
ans = [s for s, c in list(cnt.items()) if c == l]
ans.sort()
print(("\n".join(ans)))

n = int(eval(input()))
s = dict()
for i in range(n):
    si = eval(input())
    if si in s:
        s[si] += 1
    else:
        s[si] = 0
l = max(s.values())
ans = []
for i in s:
    if s[i] == l:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

-from collections import Counter - -a = [eval(input()) for i in range(n)] -cnt = Counter(a) -l = max(cnt.values()) -ans = [s for s, c in list(cnt.items()) if c == l] +s = dict() +for i in range(n): +    si = eval(input()) +    if si in s: +        s[si] += 1 +    else: +        s[si] = 0 +l = max(s.values()) +ans = [] +for i in s: +    if s[i] == l: +        ans.append(i) -print(("\n".join(ans))) +for i in ans: +    print(i)