n=int(eval(input()))

a=[]

a.append(int(eval(input())))

for i in range(1,n):

  dumy=int(eval(input()))

  for j in range(len(a)):

    if a[j]==dumy:

      break

  else:

    a.append(dumy)

    

print((len(a)))

  
n=int(eval(input()))

a=[]

a.append(int(eval(input())))

for i in range(1,n):

  dumy=int(eval(input()))

  for j in a:

    if j==dumy:

      break

  else:

    a.append(dumy)

    

print((len(a)))

  
n = int(eval(input()))
a = []
a.append(int(eval(input())))
for i in range(1, n):
    dumy = int(eval(input()))
    for j in range(len(a)):
        if a[j] == dumy:
            break
    else:
        a.append(dumy)
print((len(a)))

n = int(eval(input()))
a = []
a.append(int(eval(input())))
for i in range(1, n):
    dumy = int(eval(input()))
    for j in a:
        if j == dumy:
            break
    else:
        a.append(dumy)
print((len(a)))

-    for j in range(len(a)): -        if a[j] == dumy: +    for j in a: +        if j == dumy: