N = int(eval(input()))

D = [int(eval(input())) for i in range(N)]

D = set(D)

print((len(D)))
N = int(eval(input()))

D = [int(eval(input())) for i in range(N)]



dic = {}

for i in range(len(D)):

    dic[D[i]] = 1

print((len(dic)))
N = int(eval(input()))
D = [int(eval(input())) for i in range(N)]
D = set(D)
print((len(D)))

N = int(eval(input()))
D = [int(eval(input())) for i in range(N)]
dic = {}
for i in range(len(D)):
    dic[D[i]] = 1
print((len(dic)))

-D = set(D) -print((len(D))) +dic = {} +for i in range(len(D)): +    dic[D[i]] = 1 +print((len(dic)))