import collections

n = int(eval(input()))

s = []

for i in range(n):

    s.append(eval(input()))

    

dic = collections.Counter(s)

dic = dic.most_common()



ans = [dic[0][0]]



for i in range(len(dic)-1):

    if dic[i][1] == dic[i+1][1]:

        ans.append(dic[i+1][0])

    else:

        break

        

ans = sorted(ans)



for i in range(len(ans)):

    print((ans[i]))
n = int(eval(input()))

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



import collections

c = collections.Counter(S)

c = c.most_common()



ans = [c[0][0]]



for i in range(len(c)-1):

    if c[i][1] == c[i+1][1]:

        ans.append(c[i+1][0])

    else:

        break

        

ans = sorted(ans)

        

print(("\n".join(ans)))
import collections

n = int(eval(input()))
s = []
for i in range(n):
    s.append(eval(input()))
dic = collections.Counter(s)
dic = dic.most_common()
ans = [dic[0][0]]
for i in range(len(dic) - 1):
    if dic[i][1] == dic[i + 1][1]:
        ans.append(dic[i + 1][0])
    else:
        break
ans = sorted(ans)
for i in range(len(ans)):
    print((ans[i]))

n = int(eval(input()))
S = [eval(input()) for i in range(n)]
import collections

c = collections.Counter(S)
c = c.most_common()
ans = [c[0][0]]
for i in range(len(c) - 1):
    if c[i][1] == c[i + 1][1]:
        ans.append(c[i + 1][0])
    else:
        break
ans = sorted(ans)
print(("\n".join(ans)))

+n = int(eval(input())) +S = [eval(input()) for i in range(n)] -n = int(eval(input())) -s = [] -for i in range(n): -    s.append(eval(input())) -dic = collections.Counter(s) -dic = dic.most_common() -ans = [dic[0][0]] -for i in range(len(dic) - 1): -    if dic[i][1] == dic[i + 1][1]: -        ans.append(dic[i + 1][0]) +c = collections.Counter(S) +c = c.most_common() +ans = [c[0][0]] +for i in range(len(c) - 1): +    if c[i][1] == c[i + 1][1]: +        ans.append(c[i + 1][0]) -for i in range(len(ans)): -    print((ans[i])) +print(("\n".join(ans)))