n = int(eval(input()))

a = [int(eval(input())) for _ in range(n)]



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

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

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

-a = [int(eval(input())) for _ in range(n)] -print((len(set(a)))) +print((len(set([eval(input()) for i in range(n)]))))