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):
"""
// Author : snape_here - Susanta Mukherjee
     
 """
 
from __future__ import division, print_function
 
import os,sys
from io import BytesIO, IOBase
 
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
 
 
def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().split())
def li(): return list(mi())
 
 
def read():
    sys.stdin = open('input.txt', 'r')  
    sys.stdout = open('output.txt', 'w') 
 
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

mod=1000000007

import math

import bisect

abc="abcdefghijklmnopqrstuvwxyz"

def main():

    n=ii()
    f=[0]*(n+5)
    a=li()
    for i in range(n-1):
        f[a[i]]+=1 
    for i in range(1,n+1):
        print(f[i])

        


 
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")
 
 
def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()
 
 
if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    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()))
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()))
l=[0]*n
for i in range(n-1):
  l[a[i]-1]+=1
for i in range(n):
  print(l[i])

Solution (Python):
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

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

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

for di in d:
    print(di)

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())) 
from collections import Counter
d=dict(Counter(A))



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

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

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

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

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

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

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

buka = {i: 0 for i in range(N)}

import collections

buka_count = collections.Counter(A)

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

Solution (Python):
import sys

input = sys.stdin.readline


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

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

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


if __name__ == "__main__":
    main()

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

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

Solution (Python):

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

buka = [0 for _ in range(n)]

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

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
h = {}
for v in a:
    if v not in h:
        h[v] = 0
    h[v] += 1

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

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

buka = [0] * N

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

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

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

ans = [0]*N

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

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

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

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

for a in ans:
    print(a)

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n = int(input())
    A = tuple(map(int, input().split()))

    ans = [0] * (n + 1)
    for a in A:
        ans[a] += 1
    print(*ans[1:], sep='\n')

if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

INF = 110110110
_INFL = -INF * INF

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

ans = [0] * N

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

for a in ans:
    print(a)

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

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

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

Solution (Python):


int1 = lambda x: int(x) - 1
def II(): return int(input())

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

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solve():
    n = II()
    A = LI()

    j = {}
    for a in A:
        j[a] = j.setdefault(a, 0) + 1

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

if __name__ == '__main__':
    solve()

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



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



count = [0] *n

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

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

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

num = [0 for i in range(N+1)]

for i in  range(len(List)):
  a = List[i]
  num[a] += 1
  
for i in range(1,N+1):
  print(num[i])

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

Solution (Python):

import sys
input = sys.stdin.buffer.readline


from collections import defaultdict

con = 10 ** 9 + 7

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


def main():
	N = int(input())
	A = getlist()
	D = defaultdict(int)
	for i in range(N - 1):
		D[A[i]] += 1
	for i in range(N):
		print(D[i + 1])	
	


if __name__ == '__main__':
	main()

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

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
lis = {i:0 for i in range(1,N+1)}
for one in A:
    lis[one]+=1
for i in range(1, N+1):
    print(lis[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())
persons = list(map(int, input().split()))
ans = [0 for i in range(n)]
for p in persons:
    ans[p - 1] += 1
for a in ans:
    print(a)

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

d = {x: 0 for x in range(1,n+1)}
for x in a:
    d[x] += 1

for k in d.keys():
    print(d[k])

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

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

for i in li:
    ans_l[i-1] += 1
print(*ans_l,sep="\n")

Solution (Python):
import bisect,sys
import math
from collections import deque

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


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


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac =fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV
        
    return CONV()



sys.setrecursionlimit(200005)


def main():
    N= iRaw()
    As = isRaw()
    nbukas = [0]*N
    for a in As:
        nbukas[a-1]+=1
    return "\n".join([str(nb) for nb in nbukas])

if __name__ == "__main__":
    print(main())

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    from collections import defaultdict
    N = int(input())
    A = list(map(int, input().split()))
    dic = defaultdict(int)
    for i in A:
        dic[i] += 1
    for i in range(1, N+1):
        print(dic[i])


if __name__ == '__main__':
    main()

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

for n in range(1, n+1):
    try:
        print(a[n])
    except:
        print(0)

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

Solution (Python):
from collections import Counter


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

c = Counter(As)


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

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

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

childs = [0] * n
for num in nums:
    childs[num - 1] += 1
print('\n'.join(list(map(str, childs))))

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


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


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



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

Solution (Python):
from sys import stdin
from sys import setrecursionlimit

setrecursionlimit(10 ** 7)

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

li = [0]*n

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

for i in li:
    print(i)

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

Solution (Python):

from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product
import math

N = int(input())
s = input().split()
p = [int(w) for w in s] 
ans_list = [0 for i in range(N)]

for i in range(len(p)):
    ans_list[p[i]-1] += 1

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

Solution (Python):


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

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

for i in d:
    print(i)

Solution (Python):
N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N-1):
  D[A[i]-1].append(i)
for i in range(N):
  print(len(D[i]))

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

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

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

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft

n = int(input())
a = [int(i) - 1 for i in input().split()]
b = [[] for i in range(n)]
for i in range(n-1):
    b[a[i]].append(i)



















for i in b:
    print(len(i))

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

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

for ans in joushi:
    print(ans)

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

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


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

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

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

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

if __name__ == '__main__':
    main()

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
joshi_dic = {}
def add_dic(p):
    if not p in joshi_dic:
        joshi_dic[p] = 1
    else:
        joshi_dic[p] += 1

for i in a:
    add_dic(i)
for i in range(1, n+1):
    if not i in joshi_dic:
        print(0)
    else:
        print(joshi_dic[i])

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

res = count[1:]
for i in range(len(res)):
    print(res[i])

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

Solution (Python):
import sys

stdin = sys.stdin

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

def main():
    n = ni()
    a = na()
    anss = [0 for i in range(n)]
    for i in a:
        anss[i-1] += 1
    for i in anss:
        print(i)
if __name__ == '__main__':
    main()

Solution (Python):
inf = 10**15
mod = 10**9+7

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

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

Solution (Python):


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

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
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 LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
mo = 10**9+7

def main():
	n = II()
	a = LI()
	ans = [0]*n
	for aa in a:
		ans[aa-1]+=1
	printV(ans)


if __name__ == '__main__':
	main()

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

Solution (Python):
import sys








def main():
    solve()


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

    dc = dict()

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

    for i, a in enumerate(As):
        dc[a] += 1

    for value in dc.values():
        print(value)

    return


if __name__ == '__main__':
    main()

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

sub = [0 for _ in range(n)]
for i,j in zip(range(2,n+1),a):
    sub[j-1] += 1
for i in sub:
    print(i)

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

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

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

Solution (Python):
from collections import deque, Counter, defaultdict
from itertools import chain, combinations
import json

import bisect
import sys
import math
import bisect
from functools import lru_cache

sys.setrecursionlimit(10 ** 8)

M = 10 ** 9 + 7
INF = 10 ** 17


def main():
    N = int(input())
    
    A = [int(a) for a in input().split()]
    res = [0] * N

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

    for a in res:
        print(a)

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    


if __name__ == "__main__":
    main()

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

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

for i in range(len(a_list)):
    ret_list[a_list[i]-1] += 1

for item in ret_list:
    print(item)

Solution (Python):

import heapq
from collections import defaultdict, deque
from math import ceil, factorial, gcd
from itertools import accumulate
import sys
import bisect
import numpy as np

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

si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
lmii = lambda: list(map(int, input().split()))
smii = lambda: sorted(map(int, input().split()))



N = ii()
A = lmii()

buka = defaultdict(int)

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

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 15
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

n = I()
G = [[] for _ in range(n)]
A = LI()
for i in range(n - 1):
    G[A[i] - 1] += [i - 1]

for j in range(n):
    print(len(G[j]))

Solution (Python):
import sys


sys.setrecursionlimit(10 ** 9)



N = int(input())

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    N=ii()
    A=lmis()
    d=defaultdict(int)
    for a in A:
        a -= 1
        d[a]+=1
    for i in range(N):
        print(d[i])



main()

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

Solution (Python):
from math import sqrt,ceil




n=int(input())

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

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

for i in m:
    print(i)

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

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

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

from collections import defaultdict

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

Solution (Python):


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

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

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

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