N=int(eval(input()))

S=[]

for i in range(N):

  S.append(str(eval(input())))

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

a=[]

for i in range(N):

  a.append(eval(input()))

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

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

-S = [] +a = [] -    S.append(str(eval(input()))) -print((len(set(S)))) +    a.append(eval(input())) +print((len(set(a))))