n = int(eval(input()))

s = []

for i in range(n):

    s.append(eval(input()))



d = {}

for word in s:

    if word not in list(d.keys()):

        d[word] = 1

    else:

        d[word] += 1



max_v = max(d.values())

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



for k, v in d:

    if v == max_v:

        print(k)

n = int(eval(input()))

s = []

for i in range(n):

    s.append(eval(input()))



dic = {}



for x in s:

    if x in list(dic.keys()):

        dic[x] += 1

    else:

        dic[x] = 1



max_v = max(dic.values())

a = []

for k, v in list(dic.items()):

    if v == max_v:

        a.append(k)



ans = sorted(a)

for a in ans:

    print(a)

n = int(eval(input()))
s = []
for i in range(n):
    s.append(eval(input()))
d = {}
for word in s:
    if word not in list(d.keys()):
        d[word] = 1
    else:
        d[word] += 1
max_v = max(d.values())
d = sorted(list(d.items()), key=lambda x: x[0])
for k, v in d:
    if v == max_v:
        print(k)

n = int(eval(input()))
s = []
for i in range(n):
    s.append(eval(input()))
dic = {}
for x in s:
    if x in list(dic.keys()):
        dic[x] += 1
    else:
        dic[x] = 1
max_v = max(dic.values())
a = []
for k, v in list(dic.items()):
    if v == max_v:
        a.append(k)
ans = sorted(a)
for a in ans:
    print(a)

-d = {} -for word in s: -    if word not in list(d.keys()): -        d[word] = 1 +dic = {} +for x in s: +    if x in list(dic.keys()): +        dic[x] += 1 -        d[word] += 1 -max_v = max(d.values()) -d = sorted(list(d.items()), key=lambda x: x[0]) -for k, v in d: +        dic[x] = 1 +max_v = max(dic.values()) +a = [] +for k, v in list(dic.items()): -        print(k) +        a.append(k) +ans = sorted(a) +for a in ans: +    print(a)