N=int(eval(input()))

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

P=[0]*N

for i in range(N-1):

    P[A[i]-1]+=1

for i in range(N):

    print((P[i]))

N=int(eval(input()))

n=[0]*N

for i in input().split():

    n[int(i)-1]+=1

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

N = int(eval(input()))
n = [0] * N
for i in input().split():
    n[int(i) - 1] += 1
print((*n))

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