n = int(eval(input()))

d = {}

for i in range(n):

    s=eval(input())

    if s not in d:

        d[s] = 1

    else:

        d[s] += 1

max_d = max(d.values())

print((*sorted([kv[0] for kv in list(d.items()) if kv[1] == max_d])))

n = int(eval(input()))

d = {}

for _ in range(n):

    s = eval(input())

    if s in d:

        d[s] += 1

    else:

        d[s] = 1



m = max(d.values())

for i in sorted(k for k in d if d[k] == m):

    print(i)
n = int(eval(input()))
d = {}
for i in range(n):
    s = eval(input())
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
max_d = max(d.values())
print((*sorted([kv[0] for kv in list(d.items()) if kv[1] == max_d])))

n = int(eval(input()))
d = {}
for _ in range(n):
    s = eval(input())
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
m = max(d.values())
for i in sorted(k for k in d if d[k] == m):
    print(i)

-for i in range(n): +for _ in range(n): -    if s not in d: +    if s in d: +        d[s] += 1 +    else: -    else: -        d[s] += 1 -max_d = max(d.values()) -print((*sorted([kv[0] for kv in list(d.items()) if kv[1] == max_d]))) +m = max(d.values()) +for i in sorted(k for k in d if d[k] == m): +    print(i)