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())
arr = list(map(int, input().split()))
dic = {i: 0 for i in range(1, n+1)}

for num in arr:
    dic[num]+=1
for i in range(1, n+1):
    print(dic[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 Counter

n = int(input())
a = [int(i) for i in input().split()]
t = Counter(a)
for i in range(1, n + 1):
    if i in t.keys():
        print(t[i])
    else:
        print(0)

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

for i in list(a):
    ans[i] += 1

for i in range(n+1):
    if i == 0:
        continue
    print(ans[i])

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

list = input().split(" ")
list_int = []
for i in list:
  list_int.append(int(i)) 
k = [0]*n                         
for i in list_int:
  k[i-1] = k[i-1]+1
for j in range(n):
  print(k[j])

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

result = {i: 0 for i in range(n)}
for id in ids:
  result[id - 1] += 1

for num in result.values():
  print(num)

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

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

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

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

for C in c:
  print(C)

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):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('c2.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N = read_int()
    A = read_int_list()
    res = [0] * N
    for i in range(N - 1):
      j = A[i] - 1
      res[j] += 1    
    print(*res, sep='\n')


main()

Solution (Python):
n = int(input())
ar = list(map(int, input().split()))
mp = {}
for i in range(1,n+1):
    mp[i] = 0
for i in ar :
        mp[i] += 1


for x, y in mp.items():
    print(y)

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

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

for i in B:
    print(i)

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

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

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

for i in c:
   print(i)

Solution (Python):



def main():
	n = int(input())
	n_list = list(map(int,input().split()))
	b_list = [0]*n
	for i in n_list:
		b_list[i-1] += 1
	
	for i in b_list:
		print (i)

if __name__ == '__main__':
	main()

Solution (Python):
from collections import defaultdict

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

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

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

Solution (Python):
import collections

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

ct = collections.Counter(s)

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

Solution (Python):





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


main()

Solution (Python):
import collections


def resolve():
    n = int(input())
    woker = list(map(int, input().split()))
    woker_count = collections.Counter(woker)
    for i in range(n):
        print(woker_count[i + 1])


resolve()

Solution (Python):
N=int(input())
A=map(int,input().split())
ans={i:0 for i in range(1,N+1)}

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

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

Solution (Python):
import collections


def resolve():
    n = int(input())
    woker = list(map(int, input().split()))
    woker_count = collections.Counter(woker)
    for i in range(n):
        print(woker_count[i + 1])


resolve()

Solution (Python):
N=int(input())
A=list(map(int, input().split()))
A=sorted(A)
s=0
for num in range(1, N+1):
  count = 0
  for i in range(s, N-1):
    if A[i] == num:
      count += 1
    else:
      break
  s+=count
  print(count)

Solution (Python):
N = int(input())
subordinate_dict = {emp_num: 0 for emp_num in range(1, N + 1)}

boss_nums = [int(boss_num) for boss_num in input().split()]

for boss_num in boss_nums:
  subordinate_dict[boss_num] += 1

for num in subordinate_dict.values():
  print(num)

Solution (Python):
import collections

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

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

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

ans = [0] * n

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

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

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

c = [0] * N

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

Solution (Python):
from collections import Counter
from operator import itemgetter
N=int(input())
As=Counter([int(i) for i in input().split()])
Aslist=As.most_common()
Aslist=sorted(Aslist,key=itemgetter(0))
for num in range(N):
    if num+1 not in As.keys():
        print(0)
    else:
        print(As[num+1])

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

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

for v in result:
    print(v)

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

for r in result:
    print(r)

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

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

for j in data:
    print(j)

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

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

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

B=[0]*N

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

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

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

if __name__ == '__main__':
    main()

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

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

Clist = []
for count in range(len(A)+1):
    Clist.append(0)

for count in range(len(A)):
    Clist[A[count]-1] = Clist[A[count]-1] + 1

for count in range(0,len(A)+1):
    print(Clist[count])

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

L=[0]*N


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


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

Solution (Python):

a=int(input())
b=list(map(int, input().split()))
dic = {}
for i in range(len(b)):
    c = b[i] 
    if not c in dic.keys():
        dic[c] = 0
    dic[c] += 1

for j in range(1, a + 1):
    if j in dic.keys():
        print(dic[j])
    else:
        print(0)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
c = [0]*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())
li_a = list(map(int, input().split()))

dic = {}
for a in li_a:
    dic[a] = dic.get(a, 0) + 1

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

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):
import numpy as np
N = input()
N = int(N)
A = input().split()
L = np.zeros(N)
for i in range(N-1):
    L[int(A[i])-1] += 1
for i in range(len(L)):
    print(int(L[i]))

Solution (Python):
import sys
input=sys.stdin.readline
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())
a1 = list(map(int, input().split())) 
a2 = [0] * n

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

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

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

for i in List:
    print(i)

Solution (Python):
n = int(input())
list = [int(e) for e in input().split()]

import collections
list2 = collections.Counter(list)

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

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

    ans = {}

    for i in range(len(A)):
        if A[i] in ans:    
            ans[A[i]] += 1
        else:
            ans[A[i]] = 1
    
    for i in range(1, N):
        if i in ans:
            
            print('{}'.format(ans[i]))
        else:
            print('{}'.format(0))

    print('{}'.format(0))

if __name__ == '__main__':
    main()

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


counts = {}
for num in A:
    if num in counts:
        counts[num] += 1
    else:
        counts[num] = 1


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

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

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

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

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

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

Solution (Python):
from collections import Counter

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

c = Counter(a)

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

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

Solution (Python):



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

W=[0]*N

for a in A:
    i=int(a)-1
    W[i]+=1

for w in W:
    print(w)

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

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

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
from math import *
from copy import *
from string import *				
from random import *
from sys import stdin
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
import math

def bin1(l,r,k,t,b,val,ans):
	if(l>r):
		return ans
	else:
		mid=(l+r)//2
		v=k**mid
		if(v==val):
			return v
		elif(v>val):
			ans=mid
			return bin1(mid+1,r,k,t,b,val,ans)
		else:
			return bin1(l,mid-1,k,t,b,val,ans)
		
def bin2(l,r,k,t,b,val,ans):
	if(l>r):
		return ans
	else:
		mid=(l+r)//2
		v=t*(k**mid)+b*(mid)
		if(v==val):
			return v
		elif(v>val):
			ans=mid
			return bin2(l,mid-1,k,t,b,val,ans)
		else:
			return bin2(mid+1,r,k,t,b,val,ans)

def SieveOfEratosthenes(n): 
      
    
    
    
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
          
        
        if (prime[p] == True): 
              
            
            for i in range(p * p, n+1, p): 
                prime[i] = False
        p += 1
    return prime
def bin(l,r,ll,val):
	if(l>r):
		return -1
	else:
		mid=(l+r)//2
		if(val>=ll[mid][0] and val<=ll[mid][1]):
			return mid
		elif(val<ll[mid][0]):
			return bin(l,mid-1,ll,val)
		else:
			return bin(mid+1,r,ll,val)
def deci(n):
	s=""
	while(n!=0):
		if(n%2==0):
			n=n//2
			s="0"+s
		else:
			n=n//2
			s="1"+s
	return s
def diff(s1,s2):
	if(len(s1)<len(s2)):
		v=len(s1)
		while(v!=len(s2)):
			s1="0"+s1
			v=v+1
	else:
		v=len(s2)
		while(v!=len(s1)):
			s2="0"+s2
			v=v+1
	c=0
	for i in range(len(s1)):
		if(s1[i:i+1]!=s2[i:i+1]):
			c=c+1
	return c
from sys import stdin, stdout 
if __name__ == '__main__':
	n=int(stdin.readline())
	l=list(map(int,stdin.readline().split(" ")))
	l1=[]
	for i in range(n+1):
		l1.append(0)
	for i in range(len(l)):
		l1[l[i]]=l1[l[i]]+1
	
	for i in range(1,n+1):
		stdout.write(str(l1[i])+"\n")

Solution (Python):
n = int(input().strip())
arr = [int(i) for i in input().strip().split()]
result = {i:0 for i in range(1, n + 1)}
for i, j in enumerate(arr, 2):
    result[j] += 1
    
for i in result.values():
    print(i)

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

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = [int(s) for s in input().split(" ")]
R = [0] * (len(A) + 1)
for a in A:
	R[a - 1] += 1
for a in R:
  print(a)

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

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

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

Solution (Python):
def main():
  a = int(input())
  b =[0]*a
  
  for c in map(int, input().split()):
    b[c-1] += 1
    
  print('\n'.join(map(str, b)))

main()

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

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

Solution (Python):
N = int(input())
ids = list(map(int, input().split(" ")))
d = {}
for i in range(1, N+1):
    d[i] = 0
for i in range(N-1):
    ans = ids[i]
    d[ans]+=1
for i in d:
    print(d[i])

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

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

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

for i in x:
    print(i)

Solution (Python):

n = int(input())
a = list(map(int, input().split()))
submap = {}
for each in a:
  try:
    submap[each] += 1
  except:
    submap[each] = 1
for i in range(1, n+1):
  try:
    print(submap[i])
  except:
    print(0)

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

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

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

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

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

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
c=[]
for q in range(a):
    c.append(0)
x=int(1)
for x in b:
    c[x-1]=c[x-1]+1
for t in range(a):
    print(c[t])

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

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

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

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

for i in ans:
    print(i)

Solution (Python):
def main():
    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]

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

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

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

for v in ans:
    print(v)

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

Solution (Python):
import collections

N = int(input())

A = [int(i) for i 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()))

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

for n in num_subordinates:
	print(n)

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

o={}
for i in range(1,n+1):
  o[i]=0
  
for p in m:
  o[p]+=1

for i in range(1,n+1):
  print(o[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):
N = int(input())
liste = list(map(int, input().split()))
 
from collections import Counter
countedList = Counter(liste)


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

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


if __name__ == '__main__':
    solve()

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

Solution (Python):
from typing import List, Dict


def main(N: int, A: List[int]):
    bosses: Dict[int, List[int]] = {}

    for i, boss in enumerate(A, start=2):
        if boss not in bosses:
            bosses[boss] = [i]
        else:
            bosses[boss].append(i)

    for worker in range(1, N + 1):
        if worker not in bosses:
            print(0)
        else:
            print(len(bosses[worker]))


if __name__ == "__main__":
    N = int(input())
    A = list(map(int, (input().split())))

    main(N, A)

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

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

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

ans=[0]*(len(num_list)+1)

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

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

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

ls2 =[0 for x in range(n)]


for x in ls:
    ls2[x - 1] += 1

for x in range(n):
    print(ls2[x])

Solution (Python):
n = int(input())
a = list(map(int, 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()))

C = [0]*(N+1)
for a in A:
    C[a] += 1

for c in C[1:]:
    print(c)

Solution (Python):
import sys
import math
from collections import Counter



def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

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

def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



N=II()
A=LI()
c=Counter(A)

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

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

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

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

Solution (Python):
def abc(N, A):
    
    ans = [0] * N
    
    
    for i in range(0, N - 1):
        ans[A[i] - 1] += 1
    
    
    return(ans)



if __name__ == "__main__":
    
    
    N = int(input())
    
    
    A = list(map(int, input().split()))
    
    
    f = abc(N, A)
    
    
    for fi in f:
        print(fi)

Solution (Python):
import collections

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

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

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

Solution (Python):
a=[0]*int(input())
for i in input().split(): a[int(i)-1]+=1
for i in range(len(a)): print(f'{a[i]}')

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

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

for i in b:
    print(i)

Solution (Python):
n = int(input())
li = map(int, input().split())
r_li = [0 for _ in range(n)]

for l in li:
    r_li[l-1] += 1
for r in r_li:
    print(r)

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

[print(b) for b in B]

Solution (Python):


N = int(input())
A = input().split()
for i in range(len(A)):
  A[i] = int(A[i])

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

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

l = [0]*n

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

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

l = [0] * n

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

for j in l:
    print(j)

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

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

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

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

from collections import Counter

set_a = set(a)
c =Counter(a)
for i in range(1,n+1):
    if i in set_a:
        print(c[i])
    else:
        print(0)

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

t = [0] * 500000

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

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

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

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

for i in range(2, n+1):
    cnt[a[i]] += 1

for i in range(1, n+1):
    print(cnt[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())
A=[int(e) for e in input().split()]
C=[]
for i in range(N):
    C.append(0)
for j in A:
    C[j-1]+=1
for k in C:
    print(k)

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

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

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

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

for i in a:
    print(i)

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


B = [0] * N

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

for i in B:
    print(i)

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

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

staffs = [0] * N

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

for staff in staffs:
    print(staff)

Solution (Python):
import collections

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

boss = collections.Counter(a_list)

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

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

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

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

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

c = [0 for i in range(n+1) ]

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

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

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

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

ah = {}
for i in range(len(A)):
  ah[A[i]] = ah.get(A[i], 0)
  ah[A[i]] += 1

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

Solution (Python):
def main():
    n = int(input())
    s = [0] * n
    a = [int(x) for x in input().split()]
    for i in a:
        s[i-1] += 1
    for i in s:
        print(i)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A_list = [int(e) for e in input().split()]

buka_dict = dict()

for A in A_list:
    if A not in buka_dict:
        buka_dict[A] = 0
    
    buka_dict[A] += 1

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

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

Solution (Python):

def main():
    N, *A = map(int, open(0).read().split())
    cnt_subordinates = [0] * (N + 1)
    for a in A:
        cnt_subordinates[a] += 1
    print("\n".join(map(str, cnt_subordinates[1:])))


if __name__ == "__main__":
    main()

Solution (Python):

from collections import Counter


def main():
    N, *A = map(int, open(0).read().split())
    cnt_subordinates = Counter(A)
    ans = [cnt_subordinates[i] for i in range(1, N + 1)]
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()

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

Solution (Python):
import collections

n = int(input())
alist = map(int, input().split())

thelist = collections.defaultdict(int)

for a in alist:
    thelist[a] += 1

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

Solution (Python):
import collections
import numpy as np
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()))
n =  [0 for i in range(N) ]
for i in A:
    n[i - 1] += 1

for j in n:
    print(j)

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

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

for i in A_count:
    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 j in ans:
    print(j)

Solution (Python):
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    ret = [0]*N
    for a in A:
        ret[a-1] += 1
    print(*ret, sep="\n")


if __name__ == '__main__':
    main()

Solution (Python):
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,=map(int, input().split( ))
ans = [0]*(n+1)

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

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

Solution (Python):
employee = int(input())
boss_number = list(map(int, input().split()))
employee_zero = [0 for i in range(employee)]


for num in boss_number :
  employee_zero[num-1] += 1

for subordinate in employee_zero:
  print(subordinate)

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

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

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

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

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

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