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())

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

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

for i in ans:
    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):
    print(c[i])

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

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

data = [0] * N

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


for i in range(N):
    print("{}".format(data[i]))

Solution (Python):
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())
L = list(map(int, input().split()))

ans = [0] * N

for i in L:
    ans[i - 1] += 1

for j in ans:
    print(j)

Solution (Python):
import itertools
import math
import fractions
import functools
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 range(n):
    print(count[i])

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

b=[0]*N
for c in A:
    b[c-1]+=1

for i in b:
    print(i)

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

b = [0]*n

for x in a:
    b[x-1] += 1

for x in b:
    print(x)

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

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

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

result = [0]*N

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

for i in result:
    print(i)

Solution (Python):
import collections

N = int(input())
count = collections.Counter(list(map(int, input().split())))

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

Solution (Python):
import sys
from collections import Counter
n = int(input())
a_ls = [int(i) - 1 for i in sys.stdin.readline().split()]
ct = Counter(a_ls)
for i in range(n):
    print(ct[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 range(len(ans)):
    print(ans[i])

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

n_senior = [0] * (N-1)

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

n_senior = n_senior + [0]
print("\n".join(map(str,n_senior)))

Solution (Python):
def main():
    import sys
    input=sys.stdin.readline
    n=int(input())
    ans=[0]*n
    A=list(map(int,input().split()))
    for i in range(n-1):
        a=A[i]
        ans[a-1]+=1
    for i in range(n):
        print(ans[i])
if __name__ == '__main__':
    main()

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

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


au = [ 0 ] * n
for ai in a:
    au[ ai-1 ] += 1

for aui in au:
    print( aui )

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

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

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

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

A = list(map(int, input().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())
a=list(map(int,input().split()))
dict={}
for i in range(1,n+1):
    dict[i]=0
for x in a:
    dict[x]+=1
for v in dict.values():
    print(v)

Solution (Python):
n = int(input())
a = input().split()
b = [str(i) for i in range(1, n+1)]
d = {}

for s in a:
  if s in d:
    d[s] = d[s] + 1
  else:
    d[s] = 1

for i in b:
  if i in d:
    print(d[i])
  else:
    print(0)

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

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

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

Solution (Python):
from collections import Counter

emproyee_num = int(input())
bosses = list(map(int, input().split()))
boss_counter = Counter(bosses)

for i in range(1, emproyee_num+1):
    print(boss_counter[i])

Solution (Python):
n = int(input())
res_list = []
for _ in range(n):
    res_list.append(0)

a_list = list(map(int, input().split())) 
for a in a_list:
    res_list[a-1]+=1

for res in res_list:
    print(res)

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 range(n):
    print(ans[i])

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


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

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

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

junior=[0]*N
for j in range(N-1):
    junior[li[j]-1]+=1

for k in range(N):
    print(junior[k])

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

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

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

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

Solution (Python):
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):
n = int(input())
A = list(map(int, input().split()))
ans = [0 for _ in range(n)]
for a in A:
    ans[a-1] += 1
for ans_v in ans:
    print(ans_v)

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

Solution (Python):
from typing import List
from collections import defaultdict

def management(N: int, A_i: List[int]):
    sub_dict = defaultdict(set)

    for i in range(2, N+1):
        sub_dict[A_i[i]].add(i)

    def get_sub_num(i):
        
        
        return len(sub_dict[i])

    for i in range(1, N+1):
        print(get_sub_num(i))

if __name__ == '__main__':
    N = int(input())
    A_i = [0, 0] + list(map(int, input().split()))
    management(N, A_i)

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

Solution (Python):
import sys
import os
import bisect, collections, copy, itertools, math, string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int, input().split()))
def LS(): return list(input().split())

def solve():
	n = I()
	A = LI()

	dic = {}
	for i in range(n):
		dic.setdefault(i+1, 0)

	for a in A:
		dic[a] = dic[a] +  1

	for key in dic:
		print(dic[key])
	
if __name__ == '__main__':
	solve()

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

Solution (Python):
import collections

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

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

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 range(n):
    print(ans[j])

Solution (Python):


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


for i in range(N):
    print("{}".format(sheet[i]))

Solution (Python):
s = input()

j = [0]*int(s)

a = list(map(int,input().split()))
for i in  range(int(s)-1):
    j[a[i]] += 1
for i in range(len(j)-1):
    print(j[(i+1)])

print(0)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
ans = [0 for i in range(n)]
c = 1
if n==2:
  ans[0] = 1
for i in range(1,n-1):
  if a[i]==a[i-1]:
    c += 1
  else:
    ans[a[i-1]-1] = c
    c = 1
  if i==n-2:
    ans[a[i]-1] = c
  
for i in range(n):
  print(ans[i])

Solution (Python):
N=int(input())
A_lis=list(map(int,input().split()))
p={i:0 for i in range(1,N+1)} 
for j in A_lis:
    p[j]+=1
 
for i in range(1,N+1):
    print(p[i])

Solution (Python):
def main():
    N = int(input())
    strA = input()
    listA = strA.split(" ")

    X = [0] * N
    for i in range(0, N-1):
        X[int(listA[i])-1] += 1

    for j in X:
        print(j)

if __name__ == '__main__':
    main()

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

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

A = [int(x) for x in input().split()]
B = {}

for a in A:
    if a not in B:
        B[a] = 0
    B[a] += 1

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

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

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


for j in range(N):
    print(a[j])

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

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

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

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

Solution (Python):




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

x = [0] * (n+1)
for i in a:
  x[i] += 1

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

Solution (Python):
N=int(input())
src=list(map(int,input().split()))
T=[0]*N
for s in src:
  T[s-1]+=1
for t in T:
  print(t)

Solution (Python):
n=int(input())
buka = [0]*n
for joushi in input().split():
  buka[int(joushi)-1] += 1
print(*buka,sep='\n')

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

tmp = [0 for _ in range(N)]
for i in range(len(A)):
  tmp[A[i]-1] += 1

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

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

def main():
    N = int(input())
    A_list = list(input().split())
    buka_dict = {str(i+1): 0 for i in range(N)}
    for i in A_list:
        buka_dict[str(i)] += 1
    for i in buka_dict.values():
        print(i)


main()

Solution (Python):

n = int(input())
a = [int(i) for i in input().split()]
a.insert(0, 0)
joushi = [0]*n

for i in range(n):
    if i == 0:
        pass
    else:
        joushi[a[i]-1] += 1
for i in range(n):
    print(joushi[i])

Solution (Python):

N =int(input())
A =[int(j) for j in input().split()]
memo = [0] * N

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

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

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

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

freq = [0 for _ in range(n)]
cur = list(map(int, input().split()))

for i in cur:
    freq[i - 1] += 1

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

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

Solution (Python):



import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf

import math

import bisect


if __name__ == '__main__':
    n = int(input())
    data = list(map(int, input().split()))

    subordinate_data = [None] * n
    for i, _ in enumerate(subordinate_data):
        subordinate_data[i] = []
    i = 2 
    for v in data:
        boss = v - 1
        subordinate_data[boss].append(i)
        i += 1
    
    
    for l in subordinate_data:
        print(len(l))

Solution (Python):
import collections

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

s = collections.defaultdict(int)

for n in A:
  s[n] += 1
  
for n in range(1, N + 1):
  print(s[n])

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

nums = [0]*n

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

for boss in bosses:
    nums[boss-1] += 1

for num in nums:
    print(num)

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

Solution (Python):
n=int(input())
nl=[0 for a in range(n)]

al=input().split()
for x in range(n-1):
  nl[int(al[x])-1]+=1
  
for y in nl:
  print(y)

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

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

for i in a_0:
    print(i)

Solution (Python):
N = int(input())
A = input().split()
CountSubordinateNum = [0]*(N+1)

for boss in A:
    CountSubordinateNum[int(boss)] += 1
    
for index, count in enumerate(CountSubordinateNum):
    if index==0:
        pass
    else:
        print(count)

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

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

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

for k in range(N):
    print(buka[k])

Solution (Python):


N = int(input())
A = [0] * N
for a in [*map(int, input().split())]: A[a - 1] += 1
print(*A, sep='\n')

Solution (Python):
ninnzuu = (int)(input())
joushi = list(map(int, input().split(" ")))
buka = [0 for i in range(ninnzuu)]
for i in range(ninnzuu - 1):
    buka[joushi[i]] += 1
for i in range(1, ninnzuu):
  print(buka[i])
print(0)

Solution (Python):
from collections import defaultdict

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

d=defaultdict(int)
for item in a:
    d[item-1]+=1
for i in range(n):
    print(d[i])

Solution (Python):
from sys import stdin


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))

    ans = [0] * n

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

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


if __name__ == "__main__":
    main()

Solution (Python):

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

a = [0]*N

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

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

Solution (Python):

"""
Created on Wed May  6 00:55:08 2020

@author: shinba
"""

from collections import Counter

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

B = Counter(A)

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

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

import collections

c = collections.Counter(A)
for j in range(n):
  if j+1 in c:
    print(c[j+1])
  else: print(0)

Solution (Python):
from collections import defaultdict
import collections

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






c = collections.Counter(List)

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

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

d = {};
kk = [int(i) for i in input().split()];

for k in kk:
    v[k - 1] += 1;

for i in v:
    print(i);

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

x = input().split()

a = [int(i) for i in x]

b = [0]*n
for j in range(0,len(a)):
    k = a[j] - 1
    b[k] = b[k] + 1

for i in range(0,n):
  print(b[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):
    print(C[i])

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

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

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
a = list(map(lambda x:x-1,a))
ret = [0]*n
for ai in a:
    ret[ai]+=1

for i in ret:
    print(i)

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

Solution (Python):
from collections import Counter
N = int(input())
List = list(map(int,input().split()))
C = Counter(List)

for i in range(1,N):
  if i in C.keys():
    print(C[i])
  else:
    print(0)
print(0)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=list(map(int,input().split()))
    ll=[0]*n
    for i in range(n-1):
        ll[l[i]-1]+=1
    for i in ll:
        print(i)
resolve()

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

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

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

for a in ans:
  print(a)

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

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
B = {}
for i in A:
  if i not in B:
    B[i] = 0
  B[i] += 1
  
for j in range(1,N+1):
  try:
    print(B[j])
  except KeyError:
    print(0)

Solution (Python):
counts = [0] * int(input())
for i in map(lambda n: int(n) - 1, input().split()):
    counts[i] += 1
print(*counts, sep="\n")

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

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

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

for i in AA:
    print(i)

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

cnt = [0] * (N+1)
for a in A:
    cnt[a] += 1
print(*cnt[1:], sep='\n')

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

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

for i in range(0, n-1):
  d[int(c[i])-1] +=1

for j in d:
  print(j)

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

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

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

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

for i in range(n):
    num = num_lst[i]
    print(num)

Solution (Python):
import collections

N = int(input())

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


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

Solution (Python):


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

buka = [str(A.count(i)) for i in range(1, N+1, 1)] 

print("\n".join(buka))
"""
"""

import sys
read = sys.stdin.buffer.read 
readline = sys.stdin.buffer.readline 
readlines = sys.stdin.bufer.readlines 
sys.setrecursionlimit(10**7) 


n = readline().rstrip() 
lis = readline().rstrip().split() 


n = int(readline().rstrip()) 
a, b, c = int(readline().rstrip().split()) 
lis = [readline().rstrip().split() for _ in range(n)] 

-----------------------------------------
"""

import sys
read = sys.stdin.buffer.read 
readline = sys.stdin.buffer.readline 
readlines = sys.stdin.buffer.readlines 
sys.setrecursionlimit(10**7) 

N = int(readline().rstrip()) 
A = list(map(int,readline().rstrip().split()))

buka=[0]*N

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

L=[str(a) for a in buka]
L="\n".join(L)
print(L)

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

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    a = LI_()
    r = [0] * n
    for c in a:
        r[c] += 1

    return JA(r, "\n")


print(main())

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

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

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

Solution (Python):
import numpy as np

def calculate_num_boss(num_person, boss):
    boss_count = np.zeros([num_person])
    result, num = np.unique(boss, return_counts=True)
    for idx in range(result.shape[0]):
        ids = result[idx]
        boss_count[ids-1] = num[idx]

    return boss_count


if __name__ == "__main__":
    num_person = int(input().split()[0])
    bosses = np.array([int(i) for i in input().split()])
    count = calculate_num_boss(num_person, bosses)
    for i in count:
        print(int(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):
n=int(input())
a=list(map(int,input().split()))
l=[0]*n
for i in range(n-1):
    t=a[i]
    l[t-1]+=1
for i in range(n):
    print(l[i])

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

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

for i in range(n-1):
    t = As[i] - 1
    HowManySubordinate[t] += 1

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

Solution (Python):
import collections

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

Cs = collections.Counter(As)

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

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

ans = "\n".join(map(str,ans))
print(ans)

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

A.sort()
j = 0
cnt = 0
for i in range(1, N+1):
    if j < 0:
        print(0)
        continue
    cnt = 0
    while A[j] == i:
        j += 1
        cnt += 1
        if j == N-1:
            j = -1
            break
    print(cnt)

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def solve():
    n = II()
    A = LI()
    ans = [0] * n
    for i, a in enumerate(A):
        ans[a-1] += 1

    for a in ans:
        print(a)


if __name__ == '__main__':
    solve()

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

list = [0]*n

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

for i in list:
    print(i)

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


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

for j in A:
    B[j] += 1

for k in B.values():
    print(k)

Solution (Python):
dic = {}
N = int(input())
lists = list(map(int, input().split()))
for i in range(1, N+1):
  dic[i] = 0
for j in lists:
  dic[j] += 1
for k in dic.values():
  print(k)

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

Solution (Python):
import numpy as np

x = int(input())
l = [0] * x
A = list(map(int, input().split()))

for num in range(x-1):
    l[A[num]-1] += 1

for i in range(x):
    print(l[i])

Solution (Python):

import sys
from collections import Counter

def solve(N: int, A: "List[int]"):
    c = Counter()
    c[1] = 0
    for a in A:
        c[a] += 1
    for i in range(len(A) + 1):
        print(c[i+1])
    return



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 collections

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

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 range(1,n):
   b[a[i-1]-1] +=1

for k in range(1,n+1):
  print(b[k-1])

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

ls = [0 for i in range(N+1)]
for i in range(N-1):
  ls[A[i]] +=1
  
for i in range(1,N+1):
  print(ls[i])

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

for i in b:
  c[i-1] += 1
  
for s in range(len(c)):
  print(c[s])

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

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

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

buka = [0]*N
for josi in A:
  buka[josi -1] +=1
for b in buka:
  print(str(b))

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  
def Is(): return map(int, input().split())  
def LI(): return list(map(int, input().split()))  
def TI(): return tuple(map(int, input().split()))  
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  
def LS(): return list(input())  
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n = I()
A = LI()
N = [0]*n

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

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

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
ans = [0 for i in range(N)]
for num in A:
    ans[num - 1] += 1
for n in ans:
    print(n)

Solution (Python):
import itertools
N=int(input())
listA=list(map(int,input().split()))
listA.sort()
listA2=[0]*N
for i in listA:
  listA2[i-1]+=1
listA=set(listA)  
for i in range(1,N+1):
  if i in listA:
    print(listA2[i-1])
  else:
    print(0)

Solution (Python):

n = int(input())
inp_ls = input().split(" ")
a_ls = [int(e) for e in inp_ls[:n-1]]


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


for w in w_ls:
	print(w)

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

for i in range(len(input_line)):
  data[input_line[i]-1] += 1

for i in data:
  print(i)

Solution (Python):

n = int(input())
inp_ls = input().split(" ")
a_ls = [int(e) for e in inp_ls[:n-1]]


w_ls = {i+1: 0 for i in range(n)}
for a in a_ls:
	w_ls[a] += 1


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

Solution (Python):
n = int(input())
tmp = input().split()
a = [None]
a += tmp


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

Solution (Python):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
datas = np.zeros(N)
for a in A:
  datas[a-1] += 1
for data in datas:
  print(int(data))

Solution (Python):
N = int(input())
Mgr = [int(num) for num in input().split()]
sub = [0]*N

for i in range(len(Mgr)):
    sub[Mgr[i]-1] += 1

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

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

Solution (Python):
from _collections import defaultdict

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

res = defaultdict(int)
for a in arr:
    res[a] += 1

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

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 L[1:]:
    print(i)

Solution (Python):
N=int(input())
A=[int(n) for n in input().split()]
sub=[0]*N
for index in A:
    sub[index-1]+=1
print("\n".join(map(str,sub)))

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

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

shain = [0 for _ in range(n)]
for i in s:
    shain[i - 1] = shain[i - 1] + 1
for i in shain:
    print(i)

Solution (Python):
import numpy as np

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

B_list = np.zeros(N).astype(np.int)

for i in range(N-1):
    B_list[A_list[i]-1] += 1

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

Solution (Python):
import collections
a = int(input())
c = [int(i)-1 for i in input().split()]
b = collections.Counter(c)
for i in range(a):
  if i in b:
    print(b[i])
  else:
    print(0)

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
d = {i+1: 0 for i in range(N)}
for a in A:
    d[a] += 1
for k, v in d.items():
    print(v)

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

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

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