n = int(eval(input()))



s_dic = {}



for i in range(n):

    tmp = str(eval(input()))

    if tmp not in s_dic:

        s_dic[tmp] = 1

    else:

        s_dic[tmp] += 1



max_value = max(s_dic.values())

s_dic = sorted(list(s_dic.items()), key=lambda x:x[0])



for i in s_dic:

    if i[1] == max_value:

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



s_dic = {}



for i in range(n):

    tmp = str(eval(input()))

    if tmp not in s_dic:

        s_dic[tmp] = 1

    else:

        s_dic[tmp] += 1



tmp = max(s_dic.values())

max_s_key = [s_value[0] for s_value in list(s_dic.items()) if s_value[1] == tmp]



max_s_key = sorted(max_s_key)



for i in max_s_key:

    print(i)
n = int(eval(input()))
s_dic = {}
for i in range(n):
    tmp = str(eval(input()))
    if tmp not in s_dic:
        s_dic[tmp] = 1
    else:
        s_dic[tmp] += 1
max_value = max(s_dic.values())
s_dic = sorted(list(s_dic.items()), key=lambda x: x[0])
for i in s_dic:
    if i[1] == max_value:
        print((i[0]))

n = int(eval(input()))
s_dic = {}
for i in range(n):
    tmp = str(eval(input()))
    if tmp not in s_dic:
        s_dic[tmp] = 1
    else:
        s_dic[tmp] += 1
tmp = max(s_dic.values())
max_s_key = [s_value[0] for s_value in list(s_dic.items()) if s_value[1] == tmp]
max_s_key = sorted(max_s_key)
for i in max_s_key:
    print(i)

-max_value = max(s_dic.values()) -s_dic = sorted(list(s_dic.items()), key=lambda x: x[0]) -for i in s_dic: -    if i[1] == max_value: -        print((i[0])) +tmp = max(s_dic.values()) +max_s_key = [s_value[0] for s_value in list(s_dic.items()) if s_value[1] == tmp] +max_s_key = sorted(max_s_key) +for i in max_s_key: +    print(i)