N = int(eval(input()))

a = []

for n in range(N):

    a.append(eval(input()))

print((len(set(a))))
N = int(eval(input()))

a = []

for _ in range(N):

  a.append(eval(input()))

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

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

-for n in range(N): +for _ in range(N):