# ABC163_A

n=int(eval(input()))

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

from collections import defaultdict as dd

d=dd(int)

for aa in a:

  d[aa]+=1

for i in range(n):

  print((d[i+1]))
n = int(eval(input()))

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

from collections import Counter

c = Counter(a)



for i in range(n):

    print((c[i+1]))

# ABC163_A
n = int(eval(input()))
a = list(map(int, input().split()))
from collections import defaultdict as dd

d = dd(int)
for aa in a:
    d[aa] += 1
for i in range(n):
    print((d[i + 1]))

n = int(eval(input()))
a = list(map(int, input().split()))
from collections import Counter

c = Counter(a)
for i in range(n):
    print((c[i + 1]))

-# ABC163_A -from collections import defaultdict as dd +from collections import Counter -d = dd(int) -for aa in a: -    d[aa] += 1 +c = Counter(a) -    print((d[i + 1])) +    print((c[i + 1]))