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 itertools import repeat
 
n = int(input())
lis = list(map(int, input().split()))
d = [[0] for i in repeat(None, n)]
 
for i in lis:
  d[i - 1][0] += 1
  
for i in d:
  print(i[0])

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

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

all_list = []

for i in range(N):
    all_list.append(0)
    
for i in range(N - 1):
    all_list[input2[i] - 1] += 1
    
for i in range(N):    
    print(all_list[i])

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

buka = [0] * n

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

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

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


for k in aa:
    print(k)

Solution (Python):
"""
NTC here
"""
 


import os
import sys
from io import BytesIO, IOBase

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

def main():
    T = 1
    while T:
        T-=1
        n = iin()
        a = lin()
        ans = [0]*(n)
        for i in a:
            ans[i-1]+=1
        print(*ans, sep='\n')

        
        










BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
    main()

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

from collections import Counter
from collections import deque

c = Counter(A)
d = deque(sorted(c.most_common()))




frg = True
for i in range(1, n+1):
    if d and frg:
        _q = d.popleft()
        frg = False
    elif not d and frg:
        _q = (-1, -1)

    if _q[0] == i:
        print(_q[1])
        frg = True

    else:
        print(0)

Solution (Python):

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n = I()
    a = LI()
    ca = Counter(a)
    for i in range(1,n):
        print(ca[i])
    print(0)
    return


if __name__ == "__main__":
    solve()

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

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

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

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

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

Solution (Python):

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

Solution (Python):
import collections
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = [0]*N
for i in B.keys():
  C[i-1]=(i,B[i])

a = 0
for j in range(len(C)):
  try:
    print(C[j][1])
  except:
    print(0)
  a += 1
for l in range(N-a):
  print(0)

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

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

sorted(A)
ans = [0] * N

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

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

Solution (Python):
import sys
import math
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
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix
import itertools
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

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

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

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

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

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

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

A_boss = [0] * N
for i in A:
   A_boss[i-1] += 1

for i in A_boss:
   print(i)

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

if __name__ == "__main__":
    main()

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

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

x=[0]*N

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

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


for i in x:
  print(i)

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

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

Solution (Python):
import collections

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

c = collections.Counter(A)
for n in range(1, int(N)+1):
    print(c[n])

Solution (Python):

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

member = [0] * N
for i in A:
    member[i-1] += 1

for i in member:
    print(i)

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

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

b = sorted(a)

c = [0] * n

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

for j in c:
    print(j)

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

for x in manage:
    print(x)

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

Solution (Python):

M = int(input())
A = list(map(int, input().split())) 
ans = [0] * M

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

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

subo = {}
for i in range(1,n+1):
  subo[i] = 0
for i in arr:
  subo[i] += 1
for i in range(1,n+1):
  print(subo[i])

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

Solution (Python):
if __name__ == "__main__":
    n = int(input())
    b = [int(x) for x in input().split()]

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

    for bi in b:
        c[bi - 1] += 1
    
    for ci in c:
        print(ci)

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

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

an_map = [0] * n
for ai in an:
    an_map[ai - 1] += 1
for ai_map in an_map:
    print(ai_map)

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

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

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

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

Boss = [0] * N
for i in A:
  Boss[i - 1] += 1

for i in Boss:
  print(i)

Solution (Python):



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


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

for r in result:
    print(r)

Solution (Python):
import collections

def main():
    N = int(input())
    A = list(map(int, input().split()))
    A = collections.Counter(A)
    for i in range(1,N+1):
        print(A[i] if A[i] is not None else 0)

if __name__ == '__main__':
    main()

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

Solution (Python):
import collections

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

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

Solution (Python):
from collections import defaultdict as f
n=int(input())
d=f(int)
for a in map(int,input().split()):d[a]+=1
for k in range(1,n+1):print(d[k])

Solution (Python):
from collections import Counter

n = int(input())
aa = list(map(int, input().split()))
ctr = Counter(aa)
for i in range(len(aa) + 1):
    if i + 1 in ctr:
        print(ctr[i + 1])
    else:
        print(0)

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

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

pdict = {}

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

for elm in elms:
  pdict[elm-1] += 1
  
for i in range(N):
  print( pdict[i] )

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

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

ans = [0]*N
for r in A:
  ans[r-1] += 1

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

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


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


def main():
    N = int(input())
    cA = Counter(inpl())
    for i in range(1, N + 1):
        print(cA.get(i, 0))


if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

import collections
c = collections.Counter(a)

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

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

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

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

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

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

    for i in range(N-1):
        tmp = count[int(A[i])-1]
        count[int(A[i])-1] = tmp + 1

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

    

if __name__ == "__main__":
    main()

Solution (Python):
import math

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

m = {}
for i in A:
    if i in m:
        m[i] = m[i] + 1
    else:
        m[i] = 1


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

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

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

for item in ans:
  print(item)

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

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

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
M_list = []



for i in range(N):
  M_list.append(0)


plus_list = input().split()

for i in range(N-1):
  M_list[int(plus_list[i])-1] += 1
  
for i in range(N):
  print(M_list[i])

Solution (Python):
import collections

n = int(input())

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

c = collections.Counter(l)

print(c[1])
for i,value in enumerate(l):
  print(c[i+2])

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
 

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


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

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

    for _, v in dicts.items():
        print(v)



if __name__ == '__main__':
    main()

Solution (Python):

import sys
import numpy as np


def solve(N: int, A: "List[int]"):
    emp = [0] * N
    for a in A:
        emp[a-1]+=1

    for e in emp:
        print(e)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  
    solve(N, A)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import defaultdict
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())
    A = map(int, input().split())

    boss = defaultdict(int)
    for i, n in enumerate(A, start=2):
        boss[n] += 1
    for i in range(1, N + 1):
        print(boss[i])


main()

Solution (Python):






"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple


def solve(values: List[str], nb: int) -> Dict[int, int]:
    subord = defaultdict(int)
    for v in values:
        subord[v] += 1
    return subord


def do_job():
    "Do the work"
    LOG.debug("Start working")
    
    N = int(input())
    values = list(map(int, input().split()))
    result = solve(values, N)
    for i in range(N):
        print(result[i + 1])


def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case 
    
    


def configure_log(log_file: Optional[str] = None) -> None:
    "Configure the log output"
    log_formatter = logging.Formatter(
        "%(asctime)s - %(filename)s:%(lineno)d - " "%(levelname)s - %(message)s"
    )
    if log_file:
        handler = logging.FileHandler(filename=log_file)
    else:
        handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None

if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())


class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            
            
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)

Solution (Python):
n = int(input().strip())
a=[0] * n

for i in map(int, input().strip().split()):
    a[i-1] += 1

for i in a:
    print(i)

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

Solution (Python):
import collections

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

l = [0] * n

for i in range(n-1):
    l[a[i]-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()))
alist = [0] * n


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


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

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

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

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

Solution (Python):
from collections import Counter

N = int(input())
a_list = list(map(int, input().split())) 
a_list = map(lambda x: x-1, a_list)
counter = Counter(a_list)

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

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

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

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

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

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

Solution (Python):


import sys



















def main():
    mod = 1000000007                  
    inf = float('inf')
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    n = ii()
    L = lmi_0()
    cnt = [0] * n
    for elm in L:
        cnt[elm] += 1
    for elm in cnt:
        print(elm)

if __name__ == "__main__":
    main()

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



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

for ai in A_list:
   aa[ai-1] = aa[ai-1] + 1

for a in aa:
    print(a)

Solution (Python):
ninnzuu = int(input())
zyousi_list = input().split()
zyousi_list_int = []
buka_list = []
for i in range(len(zyousi_list)):
    zyousi_list_int.append(int(zyousi_list[i]))
    buka_list.append(0)
buka_list.append(0)
for j in range(len(zyousi_list)):
    buka_list[zyousi_list_int[j]-1] += 1
for l in range(ninnzuu):
    print(buka_list[l])

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

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

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

b = []
for h in range(n):
    b.append(0)

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

for j in b:
    print(j)

Solution (Python):
import math
if __name__ == '__main__':
    N = int(input())
    s = input().rstrip().split(' ')
    temp = [int(elem) for elem in s] 
    A = [-1]*(N+1)
    for i in range(2,N+1):
        A[i] = temp[i-2]

    assign = {}
    for i in range(2, N+1):
        if A[i] in assign:
            assign[A[i]] += 1
        else:
            assign[A[i]] = 1

    for i in range(1, N+1):
        if not i in assign:
            assign[i] = 0

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

Solution (Python):
import collections
import math
import operator as op
from functools import reduce
from collections import Counter
import numpy as np
import math
import bisect
import heapq


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def main():
    N = get_input(int)
    A = get_inputs(int)


    idx2children = [[] for _ in range(N+1)]
    for i in range(2, N+1):
        idx2children[A[i-2]].append(i)

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



    










if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

c=Counter(a)

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

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
t = [0]*(len(a)+1)

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

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

Solution (Python):

import collections

n = int(input())
List = list(map(int, input().split()))
c = collections.Counter(List)
for i in range(1,n):
  print(c[i])
print("0")

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

num=[0]*N
for i in A:
    num[i-1]+=1

for j in range(len(num)):
    print(num[j])

Solution (Python):

"""
@author: H_Hoshigi
"""
def main():
    N = int(input())
    A_list = list(map(int, input().split()))
    subordinate_counter_list = [0 for i in range(N)]
    for i in A_list:
        subordinate_counter_list[i-1] += 1
    for i in subordinate_counter_list:
        print(i)

if __name__ == "__main__":
    main()

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

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

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

buka = [0]*(int(n))

for i in list:
    buka[i-1] += 1
    
for j in range(int(n)):
    print(buka[j])

Solution (Python):


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


employee = {}  

for i,v in enumerate(A_list):
    employee.setdefault(v,[])
    employee[v].append(i+2)

for i in range(1,len(A_list)+2):
    if i in employee:
        print( len(employee[i]) )
    else:
        print(0)

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

Solution (Python):
from sys import stdin
import numpy as np

lines = stdin.readlines()

n = int(lines[0].rstrip().split()[0])
a_s = [int(x) for x in lines[1].rstrip().split()]

a_size = len(a_s)
res = np.zeros((a_size))

for i in range(a_size):
    res[a_s[i]-1] += 1

for j in range(n-1):
    print(int(res[j]))
print(0)

Solution (Python):



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

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

for s in sub:
    print(s)

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

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

Solution (Python):

from collections import Counter
N = int(input())
As = list(map(int, input().split()))
c = Counter(As)
for i in range(1,N):
    print(c[i])
print(0)

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

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

data = []

data[len(data):len(data)] = map(int, input().split())

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

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

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

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

Solution (Python):
from sys import stdin, stdout
import math,sys
from itertools import permutations, combinations
from collections import defaultdict,deque,OrderedDict
import bisect as bi
import heapq 
'''


def I():return (int(stdin.readline()))
def In():return(map(int,stdin.readline().split()))
'''



def I():return (int(input()))
def In():return(map(int,input().split()))

def find_gt(a, x):
    
    i = bi.bisect_right(a, x)
    if i != len(a):
        return i
    else:
        return -1


def main():
    try:
        n=I()
        l=list(In())
        d={}
        for x in l:
            if d.get(x,0)!=0:
                d[x]+=1
            else:
                d[x]=1
        
        for i in range(1,n+1):
            if d.get(i,0)!=0:
                print(d[i])
            else:
                print(0)

            
    except:
        pass
        
M = 998244353
P = 1000000007

if __name__ == '__main__':
    main()

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

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

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