N = int(eval(input()))

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



from collections import defaultdict

d = defaultdict(int)



for ai in A:

  d[ai] += 1



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

  print((d[n]))
N=int(eval(input()))

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

c = [0]*(N+1)

for ai in A:

  c[ai] +=1



for i in c[1:]:

    print(i)
N = int(eval(input()))
A = list(map(int, input().split()))
from collections import defaultdict

d = defaultdict(int)
for ai in A:
    d[ai] += 1
for n in range(1, N + 1):
    print((d[n]))

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

-from collections import defaultdict - -d = defaultdict(int) +c = [0] * (N + 1) -    d[ai] += 1 -for n in range(1, N + 1): -    print((d[n])) +    c[ai] += 1 +for i in c[1:]: +    print(i)