n = int(eval(input()))

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

l =[0] * (n+1)



for i in range(0,n-1):

    l[a[i]] +=1

    

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

    print((l[i]))

    
N = int(eval(input()))

l = [0] * (N+1)  # 0は利用しない

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

for a in A:

    l[a] +=1

    

for i in range(N):

    print((l[i+1]))

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

N = int(eval(input()))
l = [0] * (N + 1)  # 0は利用しない
A = list(map(int, input().split()))
for a in A:
    l[a] += 1
for i in range(N):
    print((l[i + 1]))

-n = int(eval(input())) -a = list(map(int, input().split())) -l = [0] * (n + 1) -for i in range(0, n - 1): -    l[a[i]] += 1 -for i in range(1, n + 1): -    print((l[i])) +N = int(eval(input())) +l = [0] * (N + 1)  # 0は利用しない +A = list(map(int, input().split())) +for a in A: +    l[a] += 1 +for i in range(N): +    print((l[i + 1]))