n = int(eval(input()))

data_list = []

for _ in range(n):

    data_list.append(eval(input("")))



data_list_a = set(data_list)

data_list_a = list(data_list_a)

m = len(data_list_a)



data_a = [0 for _ in range(m)]



data_dic = dict(list(zip(data_list_a, data_a)))



for i in range(n):

    data_dic[data_list[i]] += 1



data_score = list(data_dic.values())

max_value = max(data_score)

ans = []





for i in range(m):

    if data_dic[data_list_a[i]] == max_value:

        ans.append(data_list_a[i])





ans.sort()



for i in range(len(ans)):

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

list_S = []

for _ in range(n):

    list_S.append(eval(input()))



dic_S = dict()

set_S = set()

for s in list_S:

    if s in set_S:

        dic_S[s] += 1

    else:

        dic_S[s] = 1

        set_S.add(s)



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

a = 0

ans = []

for i in range(len(list_ans)):

    l = list_ans[i]

    a = max(a, l[1])

    if a <= l[1]:

        ans.append(l[0])

ans.sort()

for s in ans:

    print(s)
n = int(eval(input()))
data_list = []
for _ in range(n):
    data_list.append(eval(input("")))
data_list_a = set(data_list)
data_list_a = list(data_list_a)
m = len(data_list_a)
data_a = [0 for _ in range(m)]
data_dic = dict(list(zip(data_list_a, data_a)))
for i in range(n):
    data_dic[data_list[i]] += 1
data_score = list(data_dic.values())
max_value = max(data_score)
ans = []
for i in range(m):
    if data_dic[data_list_a[i]] == max_value:
        ans.append(data_list_a[i])
ans.sort()
for i in range(len(ans)):
    print((ans[i]))

n = int(eval(input()))
list_S = []
for _ in range(n):
    list_S.append(eval(input()))
dic_S = dict()
set_S = set()
for s in list_S:
    if s in set_S:
        dic_S[s] += 1
    else:
        dic_S[s] = 1
        set_S.add(s)
list_ans = sorted(list(dic_S.items()), key=lambda x: x[1], reverse=True)
a = 0
ans = []
for i in range(len(list_ans)):
    l = list_ans[i]
    a = max(a, l[1])
    if a <= l[1]:
        ans.append(l[0])
ans.sort()
for s in ans:
    print(s)

-data_list = [] +list_S = [] -    data_list.append(eval(input(""))) -data_list_a = set(data_list) -data_list_a = list(data_list_a) -m = len(data_list_a) -data_a = [0 for _ in range(m)] -data_dic = dict(list(zip(data_list_a, data_a))) -for i in range(n): -    data_dic[data_list[i]] += 1 -data_score = list(data_dic.values()) -max_value = max(data_score) +    list_S.append(eval(input())) +dic_S = dict() +set_S = set() +for s in list_S: +    if s in set_S: +        dic_S[s] += 1 +    else: +        dic_S[s] = 1 +        set_S.add(s) +list_ans = sorted(list(dic_S.items()), key=lambda x: x[1], reverse=True) +a = 0 -for i in range(m): -    if data_dic[data_list_a[i]] == max_value: -        ans.append(data_list_a[i]) +for i in range(len(list_ans)): +    l = list_ans[i] +    a = max(a, l[1]) +    if a <= l[1]: +        ans.append(l[0]) -for i in range(len(ans)): -    print((ans[i])) +for s in ans: +    print(s)