n = int(eval(input()))

d = []

ans = 0

for i in range(n):

  d_ = int(eval(input()))

  if d_ not in d:

    d.append(d_)

    ans += 1

print(ans)
n = int(eval(input()))

d = [int(eval(input())) for i in range(n)]

ds = set(d)

print((len(ds)))
n = int(eval(input()))
d = []
ans = 0
for i in range(n):
    d_ = int(eval(input()))
    if d_ not in d:
        d.append(d_)
        ans += 1
print(ans)

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

-d = [] -ans = 0 -for i in range(n): -    d_ = int(eval(input())) -    if d_ not in d: -        d.append(d_) -        ans += 1 -print(ans) +d = [int(eval(input())) for i in range(n)] +ds = set(d) +print((len(ds)))