n = int(eval(input()))

arr = {}



for i in range(n):

    s = eval(input())

    if not s in arr:

        arr[s] = 1

    else:

        arr[s] += 1



max_count = max(arr.values())

dic = [key[0] for key in list(arr.items()) if key[1] == max_count]



out_sort = sorted(dic)

for i in out_sort:

    print(i)

n = int(eval(input()))

arr = {}



for i in range(n):

    s = eval(input())

    if not s in arr:

        arr[s] = 1

    else:

        arr[s] += 1



max_count = max(arr.values())

dic = [key[0] for key in list(arr.items()) if key[1] == max_count]



out_sort = sorted(dic)

print(("\n".join(out_sort)))
n = int(eval(input()))
arr = {}
for i in range(n):
    s = eval(input())
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1
max_count = max(arr.values())
dic = [key[0] for key in list(arr.items()) if key[1] == max_count]
out_sort = sorted(dic)
for i in out_sort:
    print(i)

n = int(eval(input()))
arr = {}
for i in range(n):
    s = eval(input())
    if not s in arr:
        arr[s] = 1
    else:
        arr[s] += 1
max_count = max(arr.values())
dic = [key[0] for key in list(arr.items()) if key[1] == max_count]
out_sort = sorted(dic)
print(("\n".join(out_sort)))

-for i in out_sort: -    print(i) +print(("\n".join(out_sort)))