N = int(eval(input()))

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



for i in range(N-1):

    A[i] -= 1

#上司の社員番号は自分より小さい

dic = {}

for i in range(N):

    dic[i] = 0



for i in range(N-1):

    dic[A[i]] += 1

    

for i in range(N):

    print((dic[i]))
N = int(eval(input()))

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

for i in range(N-1):

    A[i] -= 1

ans = [0 for i in range(N)]

for a in A:

    ans[a] += 1

for i in range(N):

    print((ans[i]))
N = int(eval(input()))
A = list(map(int, input().split()))
for i in range(N - 1):
    A[i] -= 1
# 上司の社員番号は自分より小さい
dic = {}
for i in range(N):
    dic[i] = 0
for i in range(N - 1):
    dic[A[i]] += 1
for i in range(N):
    print((dic[i]))

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

-# 上司の社員番号は自分より小さい -dic = {} +ans = [0 for i in range(N)] +for a in A: +    ans[a] += 1 -    dic[i] = 0 -for i in range(N - 1): -    dic[A[i]] += 1 -for i in range(N): -    print((dic[i])) +    print((ans[i]))