N = int(eval(input()))

C = {}

for _ in range(N):

    s = input().strip()

    if s not in C:

        C[s] = 0

    C[s] += 1

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

C = sorted(C,key=lambda x:x[1],reverse=True)

k = C[0][1]

for i in range(len(C)):

    if C[i][1]==k:

        print((C[i][0]))

    else:break
N = int(eval(input()))

C = {}

for _ in range(N):

    s = input().strip()

    if s not in C:

        C[s]=0

    C[s] += 1

cmax = 0

for s in C:

    cmax = max(cmax,C[s])

A = []

for s in C:

    if C[s]==cmax:

        A.append(s)

A = sorted(A)

for i in range(len(A)):

    print((A[i]))
N = int(eval(input()))
C = {}
for _ in range(N):
    s = input().strip()
    if s not in C:
        C[s] = 0
    C[s] += 1
C = sorted(list(C.items()), key=lambda x: x[0])
C = sorted(C, key=lambda x: x[1], reverse=True)
k = C[0][1]
for i in range(len(C)):
    if C[i][1] == k:
        print((C[i][0]))
    else:
        break

N = int(eval(input()))
C = {}
for _ in range(N):
    s = input().strip()
    if s not in C:
        C[s] = 0
    C[s] += 1
cmax = 0
for s in C:
    cmax = max(cmax, C[s])
A = []
for s in C:
    if C[s] == cmax:
        A.append(s)
A = sorted(A)
for i in range(len(A)):
    print((A[i]))

-C = sorted(list(C.items()), key=lambda x: x[0]) -C = sorted(C, key=lambda x: x[1], reverse=True) -k = C[0][1] -for i in range(len(C)): -    if C[i][1] == k: -        print((C[i][0])) -    else: -        break +cmax = 0 +for s in C: +    cmax = max(cmax, C[s]) +A = [] +for s in C: +    if C[s] == cmax: +        A.append(s) +A = sorted(A) +for i in range(len(A)): +    print((A[i]))