n = int(eval(input()))

d = list({int(eval(input())) for _ in range(n)})

d.sort()

print((len(d)))
nums = [int(eval(input())) for _ in range(int(eval(input())))]

num_dict = dict()

for i in nums:

    num_dict[i] = True

#print(num_dict)

print((len(list(num_dict.keys()))))
n = int(eval(input()))
d = list({int(eval(input())) for _ in range(n)})
d.sort()
print((len(d)))

nums = [int(eval(input())) for _ in range(int(eval(input())))]
num_dict = dict()
for i in nums:
    num_dict[i] = True
# print(num_dict)
print((len(list(num_dict.keys()))))

-n = int(eval(input())) -d = list({int(eval(input())) for _ in range(n)}) -d.sort() -print((len(d))) +nums = [int(eval(input())) for _ in range(int(eval(input())))] +num_dict = dict() +for i in nums: +    num_dict[i] = True +# print(num_dict) +print((len(list(num_dict.keys()))))