N = int(eval(input()))

A = [int(eval(input())) for _ in range(N)]

D = {}

for a in A:

    if a in D:

        D.pop(a)

    else:

        D[a] = 1

print((sum(D.values())))
N = int(eval(input()))

A = [eval(input()) for _ in range(N)]

D = {}

for a in A:

    if a in D:

        D.pop(a)

    else:

        D[a] = 1

print((sum(D.values())))
N = int(eval(input()))
A = [int(eval(input())) for _ in range(N)]
D = {}
for a in A:
    if a in D:
        D.pop(a)
    else:
        D[a] = 1
print((sum(D.values())))

N = int(eval(input()))
A = [eval(input()) for _ in range(N)]
D = {}
for a in A:
    if a in D:
        D.pop(a)
    else:
        D[a] = 1
print((sum(D.values())))

-A = [int(eval(input())) for _ in range(N)] +A = [eval(input()) for _ in range(N)]