_, *d = open(0).read().split()

print((len(set(d))))
_, *d = open(0)

print((len(set(d))))
_, *d = open(0).read().split()
print((len(set(d))))

_, *d = open(0)
print((len(set(d))))

-_, *d = open(0).read().split() +_, *d = open(0)