n = int(eval(input()))



data = {}

names = []

max_poll = 1



for i in range(n):

    s = eval(input())

    try:

        data[s] += 1

    except:

        data[s] = 1

        names.append(s)

    if max_poll < data[s]:

        max_poll = data[s]



winner = []

for key, value in list(data.items()):

    if max_poll == value:

        winner.append(key)



winner.sort()

for i in winner:

    print(i)
n = int(eval(input()))

data = {}

max_poll = 1



for i in range(n):

    s = eval(input())

    try:

        data[s] += 1

    except:

        data[s] = 1

    if max_poll < data[s]:

        max_poll = data[s]



winner = []

for key, value in list(data.items()):

    if max_poll == value:

        winner.append(key)



winner.sort()

for i in winner:

    print(i)

n = int(eval(input()))
data = {}
names = []
max_poll = 1
for i in range(n):
    s = eval(input())
    try:
        data[s] += 1
    except:
        data[s] = 1
        names.append(s)
    if max_poll < data[s]:
        max_poll = data[s]
winner = []
for key, value in list(data.items()):
    if max_poll == value:
        winner.append(key)
winner.sort()
for i in winner:
    print(i)

n = int(eval(input()))
data = {}
max_poll = 1
for i in range(n):
    s = eval(input())
    try:
        data[s] += 1
    except:
        data[s] = 1
    if max_poll < data[s]:
        max_poll = data[s]
winner = []
for key, value in list(data.items()):
    if max_poll == value:
        winner.append(key)
winner.sort()
for i in winner:
    print(i)

-names = [] -        names.append(s)