n = int(eval(input()))

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

d = {}

for i in range(n):

    if s[i] not in d:

        d[s[i]] = 1

print((len(d)))
n = int(eval(input()))

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

print((len(set(s))))
n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
d = {}
for i in range(n):
    if s[i] not in d:
        d[s[i]] = 1
print((len(d)))

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

-d = {} -for i in range(n): -    if s[i] not in d: -        d[s[i]] = 1 -print((len(d))) +print((len(set(s))))