n = int(eval(input()))

k = []

for i in range(n):

    k.append(int(eval(input())))

print((len(set(k))))
n = int(eval(input()))

print((len(set(map(int, [eval(input()) for i in range(n)])))))
n = int(eval(input()))
k = []
for i in range(n):
    k.append(int(eval(input())))
print((len(set(k))))

n = int(eval(input()))
print((len(set(map(int, [eval(input()) for i in range(n)])))))

-k = [] -for i in range(n): -    k.append(int(eval(input()))) -print((len(set(k)))) +print((len(set(map(int, [eval(input()) for i in range(n)])))))