# -*- coding: utf-8 -*-



n = int(eval(input()))

d = [0] * n

for i in range(n):

    d[i] = int(eval(input()))



d = set(d)

d = list(d)

d.sort()



print((len(d)))

# -*- coding: utf-8 -*-



n = int(eval(input()))

d = [0] * n

for i in range(n):

    d[i] = int(eval(input()))



d = set(d)

d = list(d)



print((len(d)))

# -*- coding: utf-8 -*-
n = int(eval(input()))
d = [0] * n
for i in range(n):
    d[i] = int(eval(input()))
d = set(d)
d = list(d)
d.sort()
print((len(d)))

# -*- coding: utf-8 -*-
n = int(eval(input()))
d = [0] * n
for i in range(n):
    d[i] = int(eval(input()))
d = set(d)
d = list(d)
print((len(d)))

-d.sort()