n = int(eval(input()))

d = {}

for _ in range(n):

    s = eval(input())

    if not s in d:

        d[s] = 1

    else:

        d[s] += 1

d_max = max(d.values())

ans = [k for k, v in list(d.items()) if v == d_max]

for a in sorted(ans):

    print (a)

n = int(eval(input()))

d = {}

for _ in range(n):

    s = eval(input())

    if s in d:

        d[s] += 1

    else:

        d[s] = 1

d_max = max(d.values())

ans = [k for k, v in list(d.items()) if v == d_max]

for a in sorted(ans):

    print (a)
n = int(eval(input()))
d = {}
for _ in range(n):
    s = eval(input())
    if not s in d:
        d[s] = 1
    else:
        d[s] += 1
d_max = max(d.values())
ans = [k for k, v in list(d.items()) if v == d_max]
for a in sorted(ans):
    print(a)

n = int(eval(input()))
d = {}
for _ in range(n):
    s = eval(input())
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
d_max = max(d.values())
ans = [k for k, v in list(d.items()) if v == d_max]
for a in sorted(ans):
    print(a)

-    if not s in d: +    if s in d: +        d[s] += 1 +    else: -    else: -        d[s] += 1