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):
def main():
    n = int(input())
    a = list(map(int, input().split()))
    d = {}
    for i in range(1, n+1):
        d[i] = 0
    for b in a:
        d[b] +=1
    for k,v in d.items():
        print(v)
main()

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

Solution (Python):
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    ans = {i: 0 for i in range(1, n + 1)}
    for a in a_list:
        ans[a] += 1
    for k in ans.values():
        print(k)


if __name__ == '__main__':
    main()

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





input = sys.stdin.readline
for tt in range(1):
	n = int(input())
	
	l = list(map(int,input().split()))
	d = {}
	for i in l:
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
	for i in range(1,n+1):
		try:
			print(d[i])
		except:
			print(0)

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

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

ans = list([0]*n)

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

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

Solution (Python):
import collections


N=int(input())
li = input().split()
c = collections.Counter(li)
for i in range(1,N+1):
    if str(i) in c.keys():
        print(c[str(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):
n = int(input())
a = list(map(int, input().split()))

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

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

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

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

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

import collections
c = collections.Counter(A)

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

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

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

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

from collections import Counter

c = dict(Counter(A))

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

Solution (Python):
def main():
    n=int(input())
    a=list(map(int,input().split()))
    cnt=[0]*n
    for i in range(n-1):
        cnt[a[i]-1]+=1
    for i in range(n):
        print(cnt[i])
if __name__=="__main__":
    main()

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

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

Solution (Python):
from collections import Counter

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

Solution (Python):


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

ans=[0]*N

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

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

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

Solution (Python):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import time
import math
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
sys.setrecursionlimit(10**7)
input=lambda :sys.stdin.readline().rstrip()
N=int(input())
A=list(map(int,input().split()))
A=Counter(A)
for i in range(1,N+1):
    if i in A:
        print(A[i])
    else:
        print(0)

Solution (Python):

import sys
input = sys.stdin.readline

def answer(N,A):
    dic={key:0 for key in range(1,N+1)}
    for a in A:
        dic[a]+=1
    for ans in dic.values():
        print(ans)



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

if __name__ == '__main__':
   main()

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

res = [0] * N
for a in As:
    res[a-1] += 1
for r in res:
    print(r)

Solution (Python):

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


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


[print(x) for x in l]

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):
  if i in c.keys():
    print(c[i])
  else:
    print(0)

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

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

b = [0]*n
men = list(map(int, input().split()))

for m in men:
  b[m-1] += 1

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

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

    c = collections.Counter(a).most_common()
    ans = [0] * (n + 1)
    for i, cc in enumerate(c):
        ans[cc[0] - 1] += cc[1]
    for i in range(n):
        print(ans[i])
if __name__=='__main__':
    main()

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

sum_list = [0]*N

for a in A_list:
  sum_list[a-1]+=1

for s in sum_list:
  print(s)

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 a in L:
    print(a)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
fuck = dict()
for i in range(1, n + 1):
    fuck[i] = []

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


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

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

for item in data:
    print(item)

Solution (Python):
from sys import stdin
n = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]
x = [0] * n
for i in range(n-1):
    x[a[i]-1] += 1
for i in range(n):
    print(x[i])

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

Solution (Python):
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 bisect,collections,copy,heapq,itertools,math,operator,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())

N = I()
A = LI()
count = collections.Counter(A)
for i in range(N):
    print(count[i+1])

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

ans = [0]*(N+1)

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

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

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

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

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

for i in employees:
    print(i)

Solution (Python):
import sys
from io import StringIO
import unittest
from collections import Counter

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

    counter = Counter(a)

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


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """5
1 1 2 2"""
        output = """2
2
0
0
0"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """10
1 1 1 1 1 1 1 1 1"""
        output = """9
0
0
0
0
0
0
0
0
0"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """7
1 2 3 4 5 6"""
        output = """1
1
1
1
1
1
0"""
        self.assertIO(input, output)

if __name__ == "__main__":
    
    resolve()

Solution (Python):
from bisect import bisect_left, bisect_right
N = int(input())
A = list(map(int, input().split()))

A.sort()

for i in range(1,N+1):
  print(bisect_right(A,i) - bisect_left(A,i))

Solution (Python):
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce


def input(): return sys.stdin.readline().strip()


def INT(): return int(input())


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


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


def ZIP(n): return zip(*(MAP() for _ in range(n)))


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    main()

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

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

ans = [0] * n

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

for j in ans:
    print(j)

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

    from collections import Counter
    c=Counter(a)

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

if __name__ == '__main__':
    main()

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

d = [0] * n

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

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

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

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

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

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

Solution (Python):
import numpy as np

n = int(input())

As = np.asarray(input().split(), dtype=np.int32)

num = np.zeros(n, dtype=np.int32)

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

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

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

ans = [0] * N

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


for i in ans:
    print(i)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline                                
def I(): return list(map(int,inp().split()))

n,=I()
a=I()
ans=[0]*n
for i in a:
    ans[i-1]+=1
print('\n'.join(map(str,ans)))

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(len(s)):
    print(s[i])

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

from collections import Counter

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

Solution (Python):
N=int(input())
A=input().split()
S=[int(a)-1 for a in A]
numbers=[0]*N
for z in S:
    numbers[z]+=1
for b in numbers:
    print(b)

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



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

persons = [0]*(N+1)

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

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

Solution (Python):
from collections import Counter
def main():
  N = int(input())
  A = Counter([int(_) for _ in input().split()])
  for i in range(1, N+1):
    print(A[i])
  return

if __name__ == '__main__':
  main()

Solution (Python):





n = int(input())
a = list(map(int, input().split()))
assert len(a) == n - 1

sub = [0] * n
for b in a:
    sub[b - 1] += 1

for s in sub:
    print(s)

Solution (Python):
import sys,math,copy,queue,itertools,bisect
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))
N = NI()
A = [0 for _ in range(N+1)]
S = LI()
for i in S:
    A[i] += 1
for i in range(1,N+1):
    print (A[i])

Solution (Python):
N = int(input())
a_list = list(map(int, input().split()))
dic_a = {}
for i in range(N-1):
    if a_list[i]-1 in dic_a:
        dic_a[a_list[i]-1] += 1
    else:
        dic_a[a_list[i]-1] = 1
ans = [0 for i in range(N)]
for k,v in dic_a.items():
    ans[k] = v
for i in ans:
    print(i)

Solution (Python):

n = int(input())
a = list(map(lambda x: int(x) - 1, input().split()))
ind = [0] * n
for i, x in enumerate(a):
    ind[x] += 1
print(*ind, sep="\n")

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

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

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

Solution (Python):

import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)

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

Solution (Python):
c = [0]*int(input())
for x in input().split():
  c[int(x)-1]+=1
print('\n'.join(str(x) for x in c))

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[i])

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

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

for a in ans:
    print(a)

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))
def inpl_str():
    '''
    一行に複数の文字
    '''
    return list(input().split())

n = inp()
a = inpl()
ans = defaultdict(lambda: 0)
for i in a:
    ans[i-1] += 1
for i in range(n):
    print(ans[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 = [int(i) for i in input().split(" ")]
ans = [0 for _ in range(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()))





b = [0] * (n + 1)

for e in a:
  b[e] += 1

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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
f=[[] for j in range(n+1)]

for i in range(len(a)):
    f[a[i]-1].append(i)

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

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

rtn = np.zeros(n, dtype=int)
for i in a:
    rtn[i-1] += 1

for x in rtn:
    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


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

Solution (Python):
def main():

    N = int(input())
    A = list(map(int, input().split()))
    d = dict()
    for i in range(len(A)):
        d[A[i]] = d.get(A[i], 0) + 1
    for i in range(1, len(A)+2):
        if i in d:
            print(d[i])
        else:
            print(0)

if __name__ == '__main__':
    main()

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

Solution (Python):
import bisect
import collections
import sys

sys.setrecursionlimit(100000)
input = sys.stdin.readline
ACMOD = 1000000007
INF = 1 << 62


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


def llmi(n):
    return [lmi() for _ in range(n)]


N = int(input())
A = lmi()

d = collections.defaultdict(int)
for i, a in enumerate(A):
    d[a] += 1

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

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

Solution (Python):
import collections

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

Solution (Python):

"""
Created on Sun Apr 19 21:04:52 2020

@author: black
"""


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

for i in l:
  print(i)

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

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

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

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

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

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

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007



def main():
	a = int(input())
	al = list(IN())
	
	
	cc=[0]*a
	for v in al:
		cc[v-1]+=1
	for c in cc:
		print(c)
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque

from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [LI()for i in range(n)]



    
n=I()
A=LI()
ans=[0]*n
for a in A:
    ans[a-1]+=1
for answer in ans:
    print(answer)

Solution (Python):
def main():
    from collections import Counter
    n, *a = map(int, open(0).read().split())
    b = Counter(a)
    for i in range(1, n + 1):
        m = b.get(i)
        if m is None:
            m = 0
        print(m)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
from collections import Counter

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


def main():
    N = int(input())
    A = [0, 0] + list(map(int, input().split()))
    
    count = Counter(A)
    for i in range(1, N + 1):
        print(count[i])


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

dic = defaultdict(int)
for i in range(2, N+1):
    own_snum = i
    joshi = A[i-2]
    
    dic[joshi] += 1
for i in range(1, N+1):
    print(dic[i])

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

nodes = [[] for i in range(n)]

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

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

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

Solution (Python):

bosses = {}
n = int(input())
arr = list(map(int,input().split()))
for i in range(n):
	bosses[i+1] = 0
for i in arr:
	bosses[i]+=1

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

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

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

p_dict = {}

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

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

for k in p_dict:
    print(p_dict[k])

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

Solution (Python):
n = int(input())
a_list = map(int, input().split())
people_dic = {}
for person_num in range(1, n+1):
    people_dic[person_num] = 0
for a in a_list:
    people_dic[a] += 1

for cost in list(people_dic.values()):
    print(cost)

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

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

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

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

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

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

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

for i in ans:
    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
for i in ans:
  print(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())
line = [int(x) for x in input().split(' ')]
L = [0]*N
for i in line:
  L[i-1] += 1
for i in L:
  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

for i in range(N):
    print(ans[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_i in l:
    print(l_i)

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

res_dict = {}
for i in range(len(a)):
    if not a[i] in res_dict.keys():
        res_dict[a[i]] = 1
    else:
        res_dict[a[i]] += 1

for i in range(len(a)+1):
    if not i+1 in res_dict.keys():
        print(0)
    else:
        print(res_dict[i+1])

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):
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

N = one_int()
A=many_int()

dicts={i+1:0 for i in range(N)}

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

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

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

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

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

for i in B:
    print(i)

Solution (Python):
import math
import copy
import sys
import fractions


import decimal
import heapq
import collections
import itertools
import bisect



sys.setrecursionlimit(100001)







def getInputIntList():
    outputDataList = []
    inputData = input().split()
    outputDataList = [int(n) for n in inputData]

    return outputDataList


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList




n = int(input())
data = getInputIntList()

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

for d in data:
    ans[d] += 1

for i, a in enumerate(ans):
    if i == 0 : continue
    print(a)

Solution (Python):
import collections
from collections import defaultdict

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

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


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

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

Solution (Python):
import collections

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

count = collections.Counter(a)

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

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

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

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

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

Solution (Python):
from collections import OrderedDict

d = OrderedDict()

N = int(input())

for i in range(N):
    d[i] = 0

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

for key, value in d.items():
    print(value)