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):
from collections import deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)


args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v):
    print(["Yes", "No"][not v])



def main():
    N = input(int)
    A = input([int, N - 1])
    ans = [0] * N
    for a in A:
        ans[a - 1] += 1
    for a in ans:
        print(a)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

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

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


from collections import defaultdict
cnt = defaultdict(lambda: 0) 

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

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

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

Solution (Python):
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
import math
import bisect
import numpy as np
from collections import defaultdict, deque, Counter
from operator import itemgetter
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)




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)




if __name__ == '__main__':
    main()

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

bb = [0]*n

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

for x in bb:
    print(x)

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


if __name__ == '__main__':
    main()

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

Solution (Python):
from collections import Counter

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

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

Solution (Python):
n = int(input())
a_array = [int(x) for x in input().split()]
res_array = [0 for x in range(n + 1)]
for a in a_array:
    res_array[a] += 1
for r in res_array[1:]:
    print(r)

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

cnt = [0] * (n + 1)
for e in a:
    cnt[e] += 1

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

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n = ni()
a = nl()
l = [0]*n
for x in a:
    l[x-1] += 1
print(*l, sep='\n')

Solution (Python):
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq
n = int(input())


a = list(map(int, sys.stdin.readline().split()))

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

Solution (Python):


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

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

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

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()

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

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

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


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

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

N = ni()
A  = nl()

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

for i in BUKA:
    print(i)

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

g = [[] for _ in range(n)]

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

for i in g:
    print(len(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 math

N = int(input())
As = list(map(int, input().split()))
anss = [0] * (N + 1)
for a in As:
    anss[a] += 1
for ans in anss[1:]:
    print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, 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 SI(): return sys.stdin.readline()[:-1]

def main():
    n=II()
    aa=LI()
    cnt=[0]*(n+1)
    for a in aa:cnt[a]+=1
    for i in range(1,n+1):
        print(cnt[i])

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
print(*ans, sep="\n")

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

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

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

a = l()

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

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

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    N = Scanner.int()
    A = Scanner.map_int()
    M = [0 for _ in range(N)]
    for a in A:
        M[a - 1] += 1
    print(*M, sep='\n')


def main():
    
    solve()


if __name__ == "__main__":
    main()

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

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

def main():
    mod=10**9+7
    N=I()
    A=LI()
    ans=[0]*N
     
     
    for i in range(N-1):
        ans[A[i]-1]+=1
        
    for i in range(N):
        print(ans[i])

main()

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

sup = [0] * n

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

print('\n'.join(map(str, sup)))

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

Solution (Python):
from collections import Counter

n = int(input())
aaa = list(map(int, input().split()))
cnt = Counter(aaa)

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

Solution (Python):



from math import *
from copy import *
from heapq import *
from string import *				
from random import *				
from bisect import *				
from sys import stdin				
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(l):
	n = len(l) + 1
	d = dict(Counter(l))
	for i in range(1,n+1):
		if(i in d):
			print(d[i])
		else:
			print(0)

	

N = int(stdin.readline())
l = list(map(int, stdin.readline().rstrip().split()))
ans = solve(l)

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

Solution (Python):


def submit():
    n = int(input())
    cnt = {i + 1: 0 for i in range(n)}
    
    for a in map(int, input().split()):
        cnt[a] += 1
    
    for a in range(1, n + 1):
        print(cnt[a])


submit()

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):
from collections import Counter

N, *A = map(int, open(0).read().split())

ctr = Counter(A)
for i in range(1, N + 1):
    print(ctr[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):
def main():
    n = int(input())
    a = list(map(int, input().split()))

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

    for x in ans:
        print(x)

if __name__ == '__main__':
    main()

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

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

for a in ansl:
    print(a)

Solution (Python):
import math
from functools import reduce
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]


def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n,*A = get_all_int()

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

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

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



for b in li:
    print(b)

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

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    A = LI_()
    buka = [0 for i in range(N)]
    for i, a in enumerate(A):
        buka[a] += 1
    for b in buka:
        print(b)



main()

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

d = defaultdict(int)

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

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

Solution (Python):
def input_one_number():
    return int(input())

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

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


N = input_one_number()
A = input_multiple_number_as_list()

ans = [0] * N

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

for anss in ans:
 	print(anss)

Solution (Python):


n = int(input())

B = [0] * n

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


for x in B:
    print(x)

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

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

Solution (Python):
from collections import *
import sys
try: inp = raw_input
except: inp = input
def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]

N = ni()
A = nl()
subs = [0]*N
for a in A:
    subs[a-1] += 1
print('\n'.join(map(str, subs)))

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

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

Solution (Python):

import sys
input = sys.stdin.readline

n = int(input())
a = [int(item) for item in input().split()]
ans = [0] * n

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

for item in ans:
    print(item)

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):
N = int(input())
A = list(map(int, input().split()))

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

for b in B:
    print(b)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *A = map(int, read().split())
out_deg = [0] * (N + 1)
for x in A:
    out_deg[x] += 1

print('\n'.join(map(str, out_deg[1:])))

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

print('\n'.join(str(i) for i in ans))

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

Solution (Python):


import sys
from itertools import accumulate

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()
A = [a-1 for a in LIST()]

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

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

Solution (Python):
import sys
import collections


sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    c = collections.Counter(A)

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

    
    

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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

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


if __name__ == '__main__':
    main()

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

    ans = [0]*N
    for i in 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()))

b = [0] * n

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

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

Solution (Python):
import collections

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

CNT = collections.Counter(A)

for i in range(N):
    ctr = CNT[i + 1]
    print(ctr)

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

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

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

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

for ans in ans_array:
    print(ans)

Solution (Python):
def main():
    N = int(input())
    *a, = map(int, input().split())

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


def main():
    N = int(input())
    A = list(map(lambda x: int(x) - 1, input().split()))
    S = [[] for _ in range(N)]
    for i in range(N - 1):
        S[A[i]].append(i + 2)

    for s in S:
        print(len(s))


if __name__ == "__main__":
    main()

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

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

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

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

for cnt_i in cnt:
    print(cnt_i)

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

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

for i in l:
    print(i)

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

if __name__ == "__main__":
    main()

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

Solution (Python):


import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

N = I()
A = LI()

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

PL(ns)

Solution (Python):
import sys,os
from collections import defaultdict, deque
from math import ceil, floor
if sys.version_info[1] >= 5:
    from math import gcd
else:
    from fractions import gcd
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    MOD = 10**9+7

    N = II()
    A = LMIIS()
    num_buka = defaultdict(int)
    for a in A:
        num_buka[a] += 1
    for i in range(1,N+1):
        print(num_buka[i])


if __name__ == '__main__':
    main()

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

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

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

D = [0]*N

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

print(*D, sep="\n")

Solution (Python):
def main():
    n = int(input())
    a = [int(x) - 1 for x in input().split()]
    answer = {i: 0 for i in range(n)}
    for aa in a:
        answer[aa] += 1
    for i in range(n):
        print(answer[i])


if __name__ == '__main__':
    main()

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

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("\n".join(map(str,(ans))))

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

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

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
A = list(map(int,input().split()))
data = [0] * n
for ai in A:
  ai -= 1
  data[ai] += 1
for di in data:
  print(di)

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

Solution (Python):

def inputlist(): return [int(k) for k in input().split()]

N = int(input())
A = inputlist()
from collections import Counter
c = 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()))
count = Counter(a)
for i in range(1,n+1):
    print(count[i])

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

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

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

ans = []
for i in range(n):
    ans.append(str(d[i]))
print("\n".join(ans))

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

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

  ans=[0]*n
  for x in l:
    x-=1
    ans[x]+=1

  for i in ans:
    print(i)

main()

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


N = int(sys.stdin.buffer.readline())
A = list(map(int, sys.stdin.buffer.readline().split()))

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

Solution (Python):



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


def main():
    d = {i: 0 for i in range(1, N + 1)}
    for a in A:
        d[a] += 1
    
    for ans in d.values():
        print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n = inp()
    a = inpl()
    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])
    
if __name__ == "__main__":
    main()

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

import collections

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

C = collections.Counter(A)

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

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

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

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

nums = [0] * N
for A in As:
    nums[A-1] += 1

print('\n'.join(map(str, nums)))

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

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