Problem:
 Score : 300 points    Problem Statement A company has N members, who are assigned ID numbers 1, ..., N .  Every member, except the member numbered 1 , has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y , the person Y is said to be an immediate subordinate of the person X .  You are given the information that the immediate boss of the member numbered i is the member numbered A_i . For each member, find how many immediate subordinates it has.      Constraints  2 \leq N \leq 2 \times 10^5  1 \leq A_i < i         Input Input is given from Standard Input in the following format:  N  A_2  ...  A_N       Output For each of the members numbered 1, 2, ..., N , print the number of immediate subordinates it has, in its own line.        Sample Input 1 5
1 1 2 2      Sample Output 1 2
2
0
0
0  The member numbered 1 has two immediate subordinates: the members numbered 2 and 3 .  The member numbered 2 has two immediate subordinates: the members numbered 4 and 5 .  The members numbered 3 , 4 , and 5 do not have immediate subordinates.       Sample Input 2 10
1 1 1 1 1 1 1 1 1      Sample Output 2 9
0
0
0
0
0
0
0
0
0       Sample Input 3 7
1 2 3 4 5 6      Sample Output 3 1
1
1
1
1
1
0

Solution (Python):
n=int(input())
l=[int(i)-1 for i in input().split()]
ans=[0]*n 
from collections import Counter 
c=Counter(l)
for i in range(n):
    ans[i]=c[i]
print(*ans,sep='\n')

Solution (Python):
N = int(input())
lista = list(map(int,input().split()))

listc = [0 for i in range(N)]

for i in lista:
    listc[i-1] += 1
    
for i in listc:
    print(i)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))

buka=[]
for i in range(n):
  buka.append(0)

for i in range(n-1):
  buka[a[i]-1]+=1

for i in range(n):
  print(buka[i])

Solution (Python):
from collections import Counter

N = int(input())

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

c = Counter(As)


[print(c[i+1]) for i in range(N)]

Solution (Python):
import collections

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

c = collections.Counter(A)
for i in range(1, N+1):
  print(c[i])

Solution (Python):
N = int(input())
A = [int(a) for a in input().split()]
buka = [0] * N
for i in range(N - 1):
    buka[A[i] - 1] += 1

print("\n".join(map(str, buka)))

Solution (Python):
num = int(input())
list = list(map(int, input().split()))
ans = [0] * (num + 1)
for x in list:
    ans[x] += 1
for x in range(num):
    print(ans[x + 1])

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
results = [0] * N

for i in A:
    results[i - 1] += 1

print("\n".join(map(str, results)))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

g = [0] * (N+1)
for i in range(N-1):
    g[A[i]] += 1

for i in range(1, N+1):
    print(g[i])

Solution (Python):
N = int(input())
A = [int(n) for n in input().split()]

jn = [0] * N
for j in A:
    jn[j-1] += 1

for j in jn:
    print(j)

Solution (Python):


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

dict = {}
for i in a:
    if dict.get(i) is None:
        dict[i] = 1
    else:
        dict[i] += 1



for i in range(1, n+1):
    if dict.get(i) is None:
        print(0)
    else:
        print(dict[i])

Solution (Python):

if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    res = [0] * (len(a) + 1)

    for i in range(len(a)):
        res[a[i]-1] += 1

    for r in res:
        print(r)

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    import collections
    count_dict = collections.Counter(A)
    for i in range(N):
        if i+1 in count_dict.keys():
            pass
        else:
            count_dict[i+1] = 0
    for i in range(N):
        print(count_dict[i+1])


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  
    solve(N, A)

if __name__ == '__main__':
    main()

Solution (Python):
import math
import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
"""
int(input())
map(int,input().split())
list(map(int,input().split()))
"""


            
       

t=1
for term in range(1,t+1):
    n=int(input())
    A=list(map(int,input().split()))
    d={}
    for i in range(n-1):
        if(A[i] not in d):
            d[A[i]]=0
        d[A[i]]+=1
    for i in range(1,n+1):
        if(i in d):
            print(d[i])
        else:
            print(0)

Solution (Python):


def main():
    n = int(input())
    A = list(map(int, input().split()))

    res = [0] * n

    for i in A:
        res[i-1] += 1
    
    for num in res:
        print(num)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.insert(0,0)
A.insert(0,0)
G = {i:[] for i in range(1,N+1)}
for i in range(2,N+1):
    G[A[i]].append(i)
for i in range(1,N+1):
    print(len(G[i]))

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools










N = int(input())
A = [int(x) for x in input().split()]
ans = [0]*N
for i in range(N-1):
    ans[A[i]-1] += 1

for i in range(N):
    print(ans[i])

Solution (Python):
import collections

N = int(input())
l = list(map(int, input().split()))

c = collections.Counter(l)

for i in range(1, N+1):
  print(c[i])

Solution (Python):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = [0] * N
    for i in range(1, N):
        ans[A[i-1]-1] += 1
    for i in range(N):
        print(ans[i])


if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict

N = int(input())
A = map(int, input().split())
counter = defaultdict(int)
for a in A:
    counter[a] += 1
for i in range(N):
    print(counter[i + 1])

Solution (Python):
n, *a = map(int, open(0).read().split())

for i in range(len(a)):
    a[i] -= 1
    
cnt = [0] * n

for num in a:
    cnt[num] += 1

for ans in cnt:
    print(ans)

Solution (Python):
n = int(input())

ordinates = [0 for i in range(n)]
bosses = list(map(int, input().split()))
for boss in bosses:
	ordinates[boss-1] += 1

print("\n".join([str(item) for item in ordinates]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
count = [0]*(n+1)
for num in a:
  count[num] += 1
  
for num in range(1, n+1):
  print(count[num])

Solution (Python):










import math
import numpy as np
import statistics
import string
import sys
from array import array
from collections import deque
from functools import wraps
import time

def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

N = intinput()
A = listintinput()

joushi = [0] * N
for i in range(N-1):
    joushi[A[i]-1] += 1
for w in joushi:
    print(w)

Solution (Python):

if __name__ == '__main__':
    b= int(input())
    a = [int(i) for i in input().split()]

    list = [0]*b

    for i in a:
        list[i-1]+=1

    for i in list:
        print(i)

Solution (Python):
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

N = intinp()
A = list(mapint_inp())

l = [0]*N

for i in A:
    l[i-1] += 1

for j in l:
    print(j)

Solution (Python):
import collections
n=int(input())
a=list(map(int,input().split()))

ans=[0]*n
for i in range(n-1):
    ans[a[i]-1]+=1

for  i in range(n):
    print(ans[i])

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

Solution (Python):
N = int(input())
A = [0] * N

for x in input().split(): A[int(x) - 1] += 1
for x in A: print(x)

Solution (Python):
def main():
    N = int(input())
    A = list(map(int,input().split()))
    N = [0] * N
    for a in A:
        N[a-1] += 1
    for n in N:
        print(n)



if __name__ == "__main__":
    main()

Solution (Python):
import collections

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

c = collections.Counter(a)

for i in range(1,n+1):
    if c[i]:
        print(c[i])
    else:
        print(0)

Solution (Python):
import math
N = int(input())
lis = list(map(int,input().split()))
result = []
for i in range(N):
  result.insert(i, 0)
for zyousi in lis:
  result[zyousi-1] += 1
  
for i in range(N):
  print(result[i])

Solution (Python):
import collections
n = int(input())
a = list(map(int, input().split()))

c = collections.Counter(a)
for k in range(1,n+1):
    print(c[k])

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
a2 = [0]*n

for i in range(n-1):
    a2[a[i]-1] += 1
for i in range(n):
    print(a2[i])

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

ans = [0] * n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
ans_li = []
d = [0] * (n)

for i in range(len(a)):
    d[a[i]-1] += 1

for i in range(len(d)):
    print(d[i])

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
count=[0 for j in range(N+1)]
for i in range(N-1):
    count[A[i]]+=1

for i in range(1,N+1):
    print(count[i])

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
B = [0] * (N + 1)
for v in A:
    B[v] += 1

for v in B[1:]:
    print(v)

Solution (Python):
n = int(input())
numbers = list(map(int, input().split(" ")))

a = [0 for i in range(n)]
for i in numbers:
    a[i-1] += 1

for i in a:
    print(i)

Solution (Python):
n = int(input())
a_list = [int(s) for s in input().split()]

temp_list = [0] * (n + 1)

for a in a_list:
    temp_list[a] += 1

for i in range(1, n + 1):
    print(temp_list[i])

Solution (Python):



 
import sys
import math



 

fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile


mod=1000000007
 

def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 

t=1
for tt in range(t):
    n=int(input())
    
    a=list(map(int,sys.stdin.readline().split(' ')))
    ans=[0 for i in range(n)]
    for k in a:
        ans[k-1]+=1
    for k in ans:
        print(k)
    
    

if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Solution (Python):
N = int(input())
AA = list(map(int,input().split()))
ret = [0]*N
for i in range(N-1):
    ret[AA[i]-1] += 1
for i in range(N):
    print(ret[i])

Solution (Python):
N = int(input())
lst = list(map(int, input().split()))

buka = [0 for _ in range(N)]
for l in lst:
    buka[l-1] += 1

for b in buka:
    print(b)

Solution (Python):
from collections import Counter
from collections import defaultdict
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    d = Counter(a)
    for i in range(1, n+1):
        print(d[i])
main()

Solution (Python):
n = int(input())
a = map(int, input().split(" "))

j = [0] * n

for i in a:
  j[i - 1] += 1

for i in j:
  print(i)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

ans = [0] * (n + 1)
for i in range(n - 1):
    ans[a[i]] += 1

for i in range(1, n + 1):
    print(ans[i])

Solution (Python):
N = int(input())
lb = list(map(int,input().split()))
la =[0]*N
for i in range(N-1):
    a = lb[i]-1
    la[a] += 1
for k in range(N):
    print(la[k])

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

ans = [0 for i in range(N+1)]

for i in A:
    ans[i] += 1

for i in ans[1:]:
    print(i)

Solution (Python):
a = int(input())
b = list(map(int, input().split()))
c = []

for i in range(a):
  c.append(0)
for i in range(a-1):
  c[b[i]-1] += 1
for i in range(a):
  print(c[i])

Solution (Python):
n = int(input().strip())
inp = list(map(int, input().strip().split()))

L=[0]*n
for i in inp:
    L[i-1]+=1
for i in range(n):
    print(L[i])

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
s_n = [0] * n

for i in range(n-1):
    s_n[a[i]-1] += 1

for i in range(n):
    print(s_n[i])

Solution (Python):
import collections

n= int(input())
a=[0]
a.extend(list(map(int,input().split())))

c = collections.Counter(a)

for i in range(1,n+1):
    print(c[i])

Solution (Python):
from collections import defaultdict
def main():
    n=int(input())
    aa=list(map(int,input().split()))
    d=defaultdict(int)
    for a in aa:
        d[a]+=1
    for i in range(n):
        print(d[i+1])
main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

res = [0] * N
for a in A:
  res[a-1] += 1

for i in res:
  print(i)

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

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

Solution (Python):
from collections import Counter

n = int(input())
an = list(map(int, input().split(' ')))

c = Counter()
for a in an:
    c[a] += 1

for i in range(1, n + 1):
    print(c[i])

Solution (Python):
N =int(input())
list1 = list(map(int,input().split()))
list2 = [0]*N
for x in list1:
  list2[x-1] += 1

[print(x) for x in list2]

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
List = [0 for _ in range(N)]
for i in range(N-1):
  List[A[i]-1] += 1
for j in range(N):
  print(List[j])

Solution (Python):
from collections import defaultdict

N = int(input())
As = list(map(int, input().split()))
n = defaultdict(int)
for A in As:
    n[A-1] += 1

for i in range(N):
    print(n[i])

Solution (Python):
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = inl()
b = [0]*(n+1)
for i in a:
    b[i] += 1
for i in range(1,n+1):
    print(b[i])

Solution (Python):
N = int(input())
A = list(map(int, input().split(' ')))
ret = [0 for a in range(N)]
for a in A:
    ret[a-1] += 1
for i in range(N):
    print(ret[i])

Solution (Python):

import sys

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

ans = [0]*N
for a in A:
    ans[a-1] += 1

for a in ans:
    print(a)

Solution (Python):

from collections import Counter


def solve(*args: str) -> str:
    n = int(args[0])
    A = map(int, args[1].split())
    C = Counter(A)

    return '\n'.join(str(C[i+1]) for i in range(n))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):
import sys










sys.setrecursionlimit(10**6)
readline = sys.stdin.readline


def main():
    
    N = int(input())
    A = list(map(int, readline().split()))

    buka = [[] for i in range(N-1)]
    for i in range(N-1):
        buka[A[i]-1].append(i)

    for p in buka:
        print(len(p))
    print(0)


if __name__ == "__main__":
    main()

Solution (Python):
def solve(n, a_list):
    res_list = [0] * n
    for a in a_list:
        res_list[a - 1] += 1
    return res_list


def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    res = solve(n, a_list)
    for r in res:
        print(r)


def test():
    assert solve(5, [1, 1, 2, 2]) == [2, 2, 0, 0, 0]
    assert solve(10, [1, 1, 1, 1, 1, 1, 1, 1, 1]) == [9, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    assert solve(7, [1, 2, 3, 4, 5, 6]) == [1, 1, 1, 1, 1, 1, 0]


if __name__ == "__main__":
    test()
    main()

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

Solution (Python):

N,*A = map(int,open(0).read().split())
C = [0 for i in range(N)]

for i in range(N-1):
  C[A[i]-1]+=1

for i in range(N):
  print(C[i])

Solution (Python):
n = int(input())
joshiNum = [0 for i in range(n)]

for i in [int(i) for i in input().split()]:
    joshiNum[i-1] += 1

for i in joshiNum:
    print(i)

Solution (Python):
import numpy as np
n=int(input())

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

ans=np.zeros(n)

for i in range(n-1):
	tmp= a[i] -1
	ans[tmp] += 1
    
for i in range(n):
	print(int(ans[i]))

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())

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

ans = [0 for _ in range(N)]
for a in A:
    ans[a-1] += 1

for a in ans:
    print(a)

Solution (Python):

n = int(input())
As = [int(x) for x in input().split()]
Asa = [0 for i in range(n)]
for a in As:
    Asa[a-1] += 1
for a in Asa:
    print(a)

Solution (Python):
n = int(input())
*parents, = map(int, input().split())

child_cnt = [0] * n

for i, parent in enumerate(parents):
    child_cnt[parent - 1] += 1


for i, children in enumerate(child_cnt):
    print(children)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
ans = [0 for i in range(N)]

for val in A:
  ans[val - 1] += 1
  
for val in ans:
  print(val)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

out = [0]*n

for aa in a:
  out[aa-1] += 1

for i in range(len(out)):
  print(out[i])

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

Solution (Python):
n = int(input())
a_list = list(map(int,input().split()))
p_list = [0 for i in range(n)]
for a in a_list:
  p_list[a-1] += 1
  
for p in p_list:
  print(p)

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

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
B=[0]*N

for i in A:
    B[i-1]+=1
    
for a in B:
    print(a)

Solution (Python):
import collections

N = int(input())

A_list = list(map(int,input().split()))
c = collections.Counter(A_list)

for i in range(1,N+1):
  print(c[i])

Solution (Python):
from collections import Counter

n = int(input())
a_list = list(map(int, input().split()))
c = Counter(a_list)
for i in range(1, n+1):
    print(c[i])

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

B = [0]*N

for i in A:
	B[i-1] += 1
for j in range(len(B)):
	print(B[j])

Solution (Python):



N = int(input())
output = [0]*N

A = [int(i) for i in input().split()]

for a in A:
    output[a-1] += 1

for o in output:
    print(o)

Solution (Python):
N=int(input())
boss=list(0 for i in range(N))
a=list(map(int,input().split()))

for i in range(N-1):
    boss[a[i]-1]+=1
    
for i in range(N):
    print(boss[i])

Solution (Python):
from collections import Counter

def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    counter = Counter(A)
    for index in range(1, N+1):
        print(counter[index])

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
ans = [0] * N
for k in a:
    ans[k-1] += 1
[print(k) for k in ans]

Solution (Python):
N = int(input())
employees = [int(x) for x in input().split()]

graph = [set() for _ in range(N + 1)]

for e, boss in enumerate(employees, 2):
  graph[boss].add(e)

for b in graph[1:]:  
  print(len(b))

Solution (Python):
n = int(input())
an = list(map(int, input().split()))

ans = [0]*n

for i in an:
  ans[i-1] += 1
  
for j in ans:
  print(j)

Solution (Python):
M  =  int ( input().strip() ) ;
arr  = list (  map ( int , input().strip().split(" ") ) ) ;

arr2  = [ 0 for x in range ( M + 1 ) ] ;
for x in arr :
	arr2[x] += 1 ; 
for i in range ( 1 , len( arr2 ) )  :
	print ( arr2[i] ) ;

Solution (Python):

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

Solution (Python):
n = int(input())
s = list(map(int,input().split()))

ans = [0]*(n+1)
for i in s:
    ans[i] += 1

for i in range(1,n+1):
    print(ans[i])

Solution (Python):
n=int(input())
a=list(map(int,input().split()))

aa=[0]*n
for i in range(n-1):
    aa[a[i]-1]=aa[a[i]-1]+1
    
for i in range(n):
    print(aa[i])

Solution (Python):
import collections
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
for i in range(1,N+1):
    try:
        print(c[i])
    except:
        print(0)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
l = [0] * (n+1)

for i in a:
    l[i] += 1

for i in range(1, n+1):
    print(l[i])

Solution (Python):
n = int(input())
A = [int(x) for x in input().split()]
ans = [0] * n

for i in range(n-1):
    ans[A[i] - 1] += 1

for i in range(n):
    print(ans[i])

Solution (Python):
n = int(input())
result = [0 for i in range(n)]
lst = list(map(int, input().split()))

for i in lst:
    result[i-1] += 1

for i in result:
    print(i)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

G = [0] * (N + 1)
for i, val in enumerate(A):
    G[val] += 1

for i in range(1, N + 1):
    print(G[i])

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = [0] * n

for ai in a:
    b[ai-1] += 1
    
for bi in b:
    print(bi)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

ans = [0]*N
for i in A:
    ans[i-1] += 1

for i in ans:
    print(i)

Solution (Python):
from collections import Counter
n = int(input())
aa = list(map(int, input().split()))
dic = Counter(aa)

for i in range(n):
    print(dic.get(i+1,0))

Solution (Python):

def q3():
    n = int(input())
    boss_list = [int(i) for i in input().split(" ")]

    sub_count = {}
    for boss_number in boss_list:
        if boss_number in sub_count:
            sub_count[boss_number] += 1
        else:
            sub_count[boss_number] = 1
    
    for i in range(1, n+1):
        if i in sub_count:
            print(sub_count[i])
        else:
            print(0)
        

q3()

Solution (Python):
N = int(input())
An = list(map(int,input().split()))
nbuka = [0]*N

for A in An:
  nbuka[A-1] += 1
print(*nbuka, sep="\n")

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
from collections import Counter
c = dict(Counter(a))
for i in range(1,n+1):
    if c.get(i):
        print(c.get(i))
    else:
        print(0)

Solution (Python):

N = int(input())
A =list(map(int,input().split()))
buka_num = [0]*N

for x in range(N-2,-1,-1):
    zyousi = A[x]
    buka_num[zyousi-1] +=1
for x in range(N):
    print(buka_num[x])

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

Solution (Python):
N = int(input())
k = list(map(int,input().rstrip().split(" ")))
p = [0 for _ in range(N)]
for i in range(N -1):
    p[k[i] - 1] += 1
for i in range(N):
    print(p[i])

Solution (Python):

from sys import stdin
import sys


def nextLine(): return next(stdin)
def nextStrList(): return nextLine().split()
def nextIntList(): return [int(_) for _ in nextStrList()]

from collections import Counter

def main():
	n=int(nextLine())
	al=nextIntList()
	
	c=Counter()
	for i,a in enumerate(al):
		c[a]+=1
	for i in range(1,n+1):
		print(c[i])
		
	
if __name__=="__main__":
	main()

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

tmp = [0]*n
for i in a:
    tmp[i-1] += 1

for j in tmp:
    print(j)

Solution (Python):
n = int(input())
c_dic = {str(x):0 for x in range(1,n+1)}

for x in input().split():
  c_dic[x] += 1

for v in c_dic.values():
  print(v)

Solution (Python):
from sys import stdin
import collections


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  
    A_arr = list(map(int,_in[1].split(' ')))  
    
    cnt = collections.Counter(A_arr)
    for i in range(N):
        print(cnt[i+1])

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys,bisect,string,math,time,functools,random
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[];g=[[] for i in range(n)]
    for i in range(E):
        inp=LI();org_inp.append(inp)
        if index==0:inp[0]-=1;inp[1]-=1
        if len(inp)==2:
            a,b=inp;g[a].append(b)
            if not Directed:g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp;aa=(inp[0],inp[2]);bb=(inp[1],inp[2]);g[a].append(bb)
            if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'

    mp=[1]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)];rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase

input=lambda: sys.stdin.readline().rstrip()

class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo

show_flg=False
show_flg=True

ans=0

n=I()
a=LI()
b=[0]*(n+1)
for i in a:
    b[i]+=1
for i in range(1,n+1):
    print(b[i])

Solution (Python):
n = int(input())
a = [int(_) for _ in input().split()]
ans = [0] * (n+1)
for i in a:
    ans[i] += 1
for i in range(1, n+1):
    print(ans[i])

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

count = [0 for _ in range(N)]

for supervisor in A:
    count[supervisor-1] += 1

for i in range(len(count)):
    print(count[i])

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

ans = {}
for a in A:
    tmp = ans.get(a)
    
    if tmp == None:
        ans[a] = 1
    else:
        ans[a] = tmp + 1



for i in range(N):
    tmp = ans.get(i + 1)
    if tmp == None:
        tmp = 0
    print(tmp)

Solution (Python):
n = int(input())
lst = list(map(int, input().split()))
res = [0]*n
for i in range(n-1):
  res[lst[i]-1] += 1
for i in range(n):
  print(res[i])

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

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

Solution (Python):
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    chokuzoku = [0]*N
    for i in range(N-1):
        chokuzoku[A[i]-1]  += 1
    for j in range(N):
        print(chokuzoku[j])


if __name__ == '__main__':
    solve()

Solution (Python):
N = int(input())
A = [int(v) for v in input().split()]
ans = [0 for _ in range(N)]

for a in A:
    ans[a-1] += 1

for a in ans:
    print(a)

Solution (Python):
n = int(input())
buka = [[] for _ in range(n)]
a = [int(x) for x in input().split()]

for i in range(n-1):
    
    buka[a[i]-1].append(i+1)

for i in range(n):
    print(len(set(buka[i])))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
num=[0 for i in range(n)]

for i in a:
  num[i-1]+=1
for i in num:
  print(i)

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

Solution (Python):
from collections import Counter

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

A = Counter(A)

for i in range(1, N+1):
    print(A.get(i, 0))

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

from collections import Counter
ca = Counter(a)

for i in range(1, n+1):
    print(ca[i] if i in ca else 0)

Solution (Python):
N = int(input())
A = input().split()
A = [int(x) for x in A]

L = [0 for _ in range(N)]

for x in A:
  L[x-1] +=1

for i in range(N):
  print(L[i])

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

Solution (Python):
import collections

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

c = collections.Counter(A)

for i in range(1, N + 1):
    if i in c:
        print(c[i])
    else:
        print(0)

Solution (Python):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    nBuka = [0] * N

    for a in A:
        nBuka[a-1] += 1

    print(*nBuka, sep='\n')

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A_list = [int(a) for a in input().split()]
ans = {i: 0 for i in range(1, N+1)}
for a in A_list:
    ans[a] += 1

for i in range(1, N+1):
    print(ans[i])

Solution (Python):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()
a=n1()
ans=[0]*n

for i in range(len(a)):
    ans[a[i]-1]+=1
for i in range(len(ans)):
    print(ans[i])

Solution (Python):
b=[0]*int(input())
for i in map(int,input().split()):b[i-1]+=1
print(*b)

Solution (Python):
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    sup = {}
    for i in range(n-1):
        if a[i] in sup:
            sup[a[i]] += 1
        else:
            sup[a[i]] = 1
    for j in range(1, n+1):
        if j in sup:
            print(sup[j])
        else:
            print(0)
resolve()

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

answers = [0 for i in range(N)]
for a in A:
    answers[a-1] += 1

for ans in answers:
    print(ans)