N = int(eval(input()))

d = set(sorted([int(eval(input())) for _ in range(N)]))

print((len(d)))



n = int(eval(input()))

d = [int(eval(input())) for _ in range(n)]

d = sorted(list(set(d)))

print((len(d)))



N = int(eval(input()))
d = set(sorted([int(eval(input())) for _ in range(N)]))
print((len(d)))

n = int(eval(input()))
d = [int(eval(input())) for _ in range(n)]
d = sorted(list(set(d)))
print((len(d)))

-N = int(eval(input())) -d = set(sorted([int(eval(input())) for _ in range(N)])) +n = int(eval(input())) +d = [int(eval(input())) for _ in range(n)] +d = sorted(list(set(d)))