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()))

ans=set([])

for _ in range(n):

  ans.add(int(eval(input())))

print((len(ans)))
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()))
ans = set([])
for _ in range(n):
    ans.add(int(eval(input())))
print((len(ans)))

-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))) +ans = set([]) +for _ in range(n): +    ans.add(int(eval(input()))) +print((len(ans)))