N = int(eval(input()))

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

M = [0] * N



for i in range(0, len(A)):

    M[(A[i]-1)] += 1

    i += 1



for j in range(0, N):

    print((M[j]))

    j += 1

N = int(eval(input()))

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

M = [0] * N

 

for i in range(0, len(A)):

    M[(A[i]-1)] += 1

 

for j in range(0, N):

    print((M[j]))

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

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

-    i += 1 -    j += 1