n = int(eval(input()))

A = list(map(int, input().split())) # n-1



from collections import Counter



c = dict(Counter(A))



for i in range(1, n + 1):

	print((c.get(i, 0)))
n = int(eval(input()))

A = [-1, -1] + list(map(int, input().split())) # n-1



cnt = [0] * (n + 1)



for i in range(2, n + 1):

	cnt[A[i]] += 1



for i in range(1, n + 1):

	print((cnt[i]))
n = int(eval(input()))
A = list(map(int, input().split()))  # n-1
from collections import Counter

c = dict(Counter(A))
for i in range(1, n + 1):
    print((c.get(i, 0)))

n = int(eval(input()))
A = [-1, -1] + list(map(int, input().split()))  # n-1
cnt = [0] * (n + 1)
for i in range(2, n + 1):
    cnt[A[i]] += 1
for i in range(1, n + 1):
    print((cnt[i]))

-A = list(map(int, input().split()))  # n-1 -from collections import Counter - -c = dict(Counter(A)) +A = [-1, -1] + list(map(int, input().split()))  # n-1 +cnt = [0] * (n + 1) +for i in range(2, n + 1): +    cnt[A[i]] += 1 -    print((c.get(i, 0))) +    print((cnt[i]))