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())
B = [0 for i in range(N)]
A = list(map(int,input().split()))
for i in range(0,N-1):
  B[A[i]-1] += 1
for i in range(N):
  print(B[i])

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

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

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

boss = list(map(int,input().split()))
             
shain = [0]*n

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

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

ans = [0] * (N+1)

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

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

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

joshi = {}

for i in range(1, n+1):
    joshi[str(i)] = 0

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

for key in joshi.keys():
    print(joshi[key])

Solution (Python):
from collections import Counter

N = int(input())
A = [int(x) for x in input().split()]
dict = Counter(A)

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

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

Solution (Python):
n = int(input())
a = [int(c) for c in input().split()]
out = [0] * n
for item in a:
    out[item] += 1
for item in out[1:]:
    print(item)
print(0)

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

ans = [0] * (n*10)

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

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

Solution (Python):
N = int(input())
As = [int(i) for i in input().split()]

d = {}
for idx in range(N):
    d[idx+1] = 0

for a in As:
    d[a] += 1

for i in d.values():
    print(i)

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


def main():
    n = int(input())
    a = list(map(int, input().split()))
    table = [0] * (2*10**5+5)
    for i in range(len(a)):
        table[a[i]-1] += 1

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


main()

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

Solution (Python):
import collections

N = int(input().split()[0])
a_list = list(map(int, input().split()))
c = collections.Counter(a_list)
ans = ""
for i in range(N):
    ans += str(c[i + 1]) + "\n"
print(ans)

Solution (Python):













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


ans = [0] * (N+1)

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

ans = ans[1:]
print(*ans,sep="\n")

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

for i in C:
    print(i)

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

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

Solution (Python):
k = int(input())
l = list(map(int,input().split()))
x = map(lambda x: x -1, l)
import collections
c = collections.Counter(x)
for i in range(k):
  print(c[i])

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

ans = [0] * (N + 1)
for i in range(len(A)):
    ans[A[i]] += 1
for i in range(1, N + 1):
    print(ans[i])

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

for i in lst:
    print(i)

Solution (Python):
N = int(input())
l = [0]*N
boss = input().split(" ")
for i in range(N-1):
  l[int(boss[i])-1]+=1
for j in range(N):
  print(l[j])

Solution (Python):
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
c = 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(N-1):
    B[A[i]-1] += 1

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

Solution (Python):
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import permutations,combinations
from collections import defaultdict,Counter


from functools import reduce
from pprint import pprint

def myinput():
    return map(int,input().split())

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col):
    data.sort(key=lambda x:x[col],reverse=False)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

n = int(input())
a = list(myinput())


ls = [ [] for _ in range(n) ]
for i in range(n-1):
    b = a[i] - 1
    ls[b].append(i)


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

Solution (Python):


import collections

n = int(input())
A = list(int(x) for x in 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()))
ans = []
dic = {}
for i in range(len(A)):
  dic[A[i]] = dic.get(A[i])+1 if dic.get(A[i])!=None else 1
for i in range(1,n+1):
  p = dic.get(i)
  print(p if p != None else 0)

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

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

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

Solution (Python):
N = int(input())
L = [int(s) for s in input().rstrip().split(' ')]
L_0 = [0 for i in range(N)]
for x in L:
    L_0[x-1] += 1
for y in L_0:
    print(y)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
result = [0] * (N)
for i in a:
    result[i-1] += 1
for i in result:
    print(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 a in ans:
    print(a)

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

d = {}
for i in range(1,N+1):
    d[i] = 0

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

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

Solution (Python):

import collections
n = int(input())
lis = input().split()



li = collections.Counter(lis)
for i in range(n):
    
    print(li[str(i+1)])

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

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

for j in ans:
    print(j)

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):
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    A = list(map(int, input().split()))
    BUKA = [0]*N
    for i in range(N-1):
        BUKA[A[i]-1] += 1
    for i in BUKA:
        print(i)

if __name__ == '__main__':
    main()

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

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

N = int(input())
dic = {}
for i in range(N):
    dic[i] = 0
for a in list(map(lambda x: int(x)-1, input().split())):
    dic[a] += 1
for i in range(N):
    if dic.get(i):
        print(dic.get(i))
    else:
        print(0)

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

A = list(map(int, input().split()))
counter = [0] * n

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

for j in counter:
    print(j)

Solution (Python):
N = int(input())
As = [int(s) for s in input().split()]

T = [0 for c in range(N+1)]

for v in As:
    T[v] += 1

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

Solution (Python):
def mgmt(n,al):
    b = [0 for i in range(n)]
    for a in al:
        b[a-1] += 1
    [print(i) for i in b]

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

mgmt(n, al)

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

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

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

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

Solution (Python):

N = int(input())


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

E = [0]*N

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

for i in E:
    print(i)

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

for v in t:
    v-=1
    ans[v] += 1

for v in ans:
    print(v)

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

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

B = [0] * N

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

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

Solution (Python):
from collections import defaultdict as d

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

t = d(list)
for i in range(n - 1):
	t[arr[i]].append(i+1)

for i in range(1, n + 1):
	if i in t.keys():
		print(len(t[i]))
	else:
		print(0)

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
print(*ans[1:])

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

Solution (Python):

N = int(input().strip())
A = [int(str) for str in input().strip().split()]

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

for b in B:
    print(b)

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

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

for i_b in b:
    print(i_b)

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

for i in range(n-1):
    lm[l[i]-1]+=1

for i in lm:
    print(i)

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

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

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


num = {key:0 for key in keys}
for i in A:
    num[i] += 1

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

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

l = {}
for a in A:
    if a in l:
        l[a] += 1
    else:
        l[a] = 1

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

Solution (Python):

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


for i in range(1, n + 1):
    if i <= m:
        print(a[i])
    else:
        print(0)

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

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

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 v in ans:
    print(v)

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

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

memo=[0]*(N+1)

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

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

Solution (Python):
from collections import  deque
import sys
import bisect
import math
import itertools
from queue import deque
from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)


N = inp()
A = [0] + inp_list()

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

Solution (Python):
from collections import Counter

n = int(input())

count = Counter(map(int, input().split()))

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

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

res = [0]*N

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

for i in res:
    print(i)

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

a = [int(x)-1 for x in input().split()]

from collections import defaultdict

d = defaultdict(int)


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

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

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

for a in A:
  L[a - 1] += 1
for l in L:
  print(l)

Solution (Python):
from collections import Counter

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

cnt = Counter(A)

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

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

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


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

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

Solution (Python):


from collections import defaultdict

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

d = defaultdict(int)
for x in a:
    d[x] += 1

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

Solution (Python):
from collections import Counter
def solve():

    N = int(input())
    A = list(map(int,input().split()))
    cnter = Counter(A)
    for shain_id in range(1,N+1):
        print(cnter[shain_id])

if __name__ == '__main__':
    solve()

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

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

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

li = [0] * n

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

for i in li:
    print(i)

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

Solution (Python):
import numpy as np
if __name__ == "__main__":
    
    
    
    
    N = int(input())
    
    line = np.array(list(map(int, input().rstrip().split(' '))))
    ans = np.zeros(N)
    for l in line:
        ans[l-1] += 1
    for a in ans:
        print(int(a))

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

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

ans = [0 for i in range(n)]

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

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

Solution (Python):
n = int(input())
*a, = map(int, input().split())
d = {}
for i in range(1, -~n): d[i] = 0
for i in a:
    if i not in d: d[i] = 1
    else: d[i] += 1
for i in d.values():
    print(i)

Solution (Python):
N = int(input())
L = [i for i in map(int,input().split())]
ans = dict()
for i in range(1,N+1):
    ans[i] = 0
for el in L:
    if el in ans:
        ans[el] += 1
for i in range(1,N+1):
    print(ans[i])

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    man = [0] * N

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

    for i in man:
        print(i)
    

    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):
N = int(input())
A = list(map(int,input().split()))
listA = [0 for i in range(N)]

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

for i in range(N):
    print(listA[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 j in range(N):
    print(ans[j])

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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



if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter
n,*a = map(int,open(0).read().split())
c = Counter(a)
for i in range(n):
  print(c[i+1])

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

buka = [0] * N


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

for b in buka:
    print(b)

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

b = [0] * n

for i in range(n - 1):
  ai = int(a[i])
  b[ai - 1] += 1

for j in range(n):
  print(b[j])

Solution (Python):
import math

n = int(input())
aL = list(map(int, input().split(" ")))

cnt = [0 for _ in range(n)]
cnt[0] = 1

for i in range(1, n - 1):
    cnt[aL[i] - 1] += 1

for c in cnt:
    print(c)

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

Solution (Python):
from collections import Counter

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

counter = Counter(a)

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

Solution (Python):
import sys

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

mydict = {}

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

for i in range(len(A)):
    mydict[A[i]] += 1

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

Solution (Python):
import collections

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

c = collections.Counter(a)

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

Solution (Python):
import collections
N = int(input())
A_list = list(map(int,input().split()))

g = collections.Counter(A_list)
for i in range(1,N+1):
    print(g[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 = list(map(int,input().split()))
ans_l = [0]*n
for i in A:
    ans_l[i-1]+=1
for i in ans_l:
    print(i)

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
count = [0]*N
for a in A:
  count[a-1] += 1
for n in range(N):
  print(count[n])

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

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

score= [0]*(x+2)

line = [int(x) for x in input().split()]

for i in range(0,x-1):
    score[line[i]] = score[line[i]] + 1


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

Solution (Python):

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

c=[0]*N
for i in A:
    c[i-1]+=1
for k in c:
    print(k)

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

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

i=0
B=[0]*N
while i<len(A):
    B[A[i]-1]+=1
    i+=1

for i in B:
    print(i)

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

l = Counter(A)

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

Solution (Python):
import sys
N=int(sys.stdin.readline().strip())
A=map(int, sys.stdin.readline().split())
L=[ 0 for _ in range(N) ]
for a in A:
    L[a-1]+=1
for x in L:
    print x

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

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

worker = [0] * N


for i in range(len(A)):
    worker[A[i] - 1] += 1

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

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

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

for s in score:
    print(s)

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

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

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

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

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

N = i_i()
A = i_l()

h = {}

for i in range(len(A)):
    h[i] = 0


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

for x in h.values():
    print(x)

print(0)

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

for i in range(n-1):
	c[l[i]-1] += 1

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

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

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

boss = [0] * N

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

for b in boss:
    print(b)

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

lis = {i:0 for i in range(1,N+1)}
for a in A:
	lis[a]+=1

for l in lis.values():
	print(l)

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

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

for aa in a:
    b[aa-1] += 1
    
for bb in b:
    print(bb)

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):
n=int(input())
al=list(map(int, input().split()))
b=[0]*n

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

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

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

Solution (Python):
from collections import defaultdict
d = defaultdict(int)

N = int(input())

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
N = int(input())
A = [int(i) for i in readline().split()]

from collections import Counter
c = Counter(A)

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

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 ans:
    print(i)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
count = {x:0 for x in range(1, N+1)}
for elt in A:
    count[elt] += 1
for x in range(1, N+1):
    print(count[x])

Solution (Python):


''' 
------------------------
author : iiou16
------------------------
'''

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

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



if __name__ == '__main__':
    main()

Solution (Python):
import collections
n=int(input())
a=list(map(int, input().split()))
a=collections.Counter(a)
for i in range(1,n+1):
    print(a.get(i, 0))

Solution (Python):
import collections

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

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

def resolve():
    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)

if __name__ == '__main__':
    resolve()

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

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

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

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

for b in B:
    print(b)

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

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

Solution (Python):
from sys import stdin
import math
import fractions

n = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]

count = [0] * n

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


for c in count:
    print(c)

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 a:
  b[i-1]+=1
for i in b:
  print(i)

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

s = [0] * n

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

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

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

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
a = li()

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

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

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

Solution (Python):
import numpy as np
N=int(input())
a=input().split(" ")
n=np.zeros(N)

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

Solution (Python):
from collections import Counter
N=int(input())
A=list(map(int,input().split()))
d={i+1:0 for i in range(N)}
d.update(Counter(A))
k=sorted(d.keys())
for i in k:
    print(d[i])

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

if __name__ == '__main__':
    main()

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

shain=[None]


class Worker:
    def __init__(self):
        self.buka=[]



for i in range(n):
    zako=Worker()
    shain.append(zako)
    
    
for i in range(2,n+1):
    shain[a[i-2]].buka.append(i)

for i in range(1,n+1):
    print(len(shain[i].buka))

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

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



for i in B:
  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):
import sys
from math import sqrt
from collections import Counter, defaultdict, deque

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


def I():
    return int(input())


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


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    n = I()
    a_list = LI()

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

    pass


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a_list = [int(i) for i in input().split()]
a_dict = {}

for a in a_list:
    if a in a_dict.keys():
        a_dict[a] += 1
    else:
        a_dict[a] = 1

for i in range(n):
    if i+1 in a_dict.keys():
        print(a_dict[i+1])
    else:
        print(0)

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

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] += 1

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

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

Solution (Python):


import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    n = int(sys.stdin.readline())
    a = list(map(int, sys.stdin.readline().split()))
    d = dict()
    for i in range(1, n + 1):
        d[i] = 0
    for i in a:
        d[i] += 1
    for i in d.values():
        print(i)


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()

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

number_subordinate = [0] * n

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


for number in number_subordinate:
    print(number)

Solution (Python):

N = int(input())

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

import collections
dic=dict(collections.Counter(A))

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

Solution (Python):
from collections import defaultdict as dd
n = int(input())
A = list(map(int, input().split()))
dic = dd(lambda: 0)
for a in A:
    dic[a] += 1

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

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