N=int(eval(input()))

A=[]

for i in range(N):

   A.append(eval(input())) 

A=list(set(A))

print((len(A)))
n=int(eval(input()))

a=set(int(eval(input())) for i in range(n))

print((len(a)))
N = int(eval(input()))
A = []
for i in range(N):
    A.append(eval(input()))
A = list(set(A))
print((len(A)))

n = int(eval(input()))
a = set(int(eval(input())) for i in range(n))
print((len(a)))

-N = int(eval(input())) -A = [] -for i in range(N): -    A.append(eval(input())) -A = list(set(A)) -print((len(A))) +n = int(eval(input())) +a = set(int(eval(input())) for i in range(n)) +print((len(a)))