n = int(eval(input()))

l = [0] * n

a = list(map(int,input().split()))



for i in range(n - 1):

    l[a[i] - 1] += 1



for i in range(n):

    print((l[i]))
n = int(eval(input()))

a = list(map(int,input().split()))

m = [0] * (n+1)

for i in a:

    m[i] += 1

for i in m[1:]:

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

n = int(eval(input()))
a = list(map(int, input().split()))
m = [0] * (n + 1)
for i in a:
    m[i] += 1
for i in m[1:]:
    print(i)

-l = [0] * n -for i in range(n - 1): -    l[a[i] - 1] += 1 -for i in range(n): -    print((l[i])) +m = [0] * (n + 1) +for i in a: +    m[i] += 1 +for i in m[1:]: +    print(i)