Problem:
 Score : 300 points    Problem Statement A company has N members, who are assigned ID numbers 1, ..., N .  Every member, except the member numbered 1 , has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y , the person Y is said to be an immediate subordinate of the person X .  You are given the information that the immediate boss of the member numbered i is the member numbered A_i . For each member, find how many immediate subordinates it has.      Constraints  2 \leq N \leq 2 \times 10^5  1 \leq A_i < i         Input Input is given from Standard Input in the following format:  N  A_2  ...  A_N       Output For each of the members numbered 1, 2, ..., N , print the number of immediate subordinates it has, in its own line.        Sample Input 1 5
1 1 2 2      Sample Output 1 2
2
0
0
0  The member numbered 1 has two immediate subordinates: the members numbered 2 and 3 .  The member numbered 2 has two immediate subordinates: the members numbered 4 and 5 .  The members numbered 3 , 4 , and 5 do not have immediate subordinates.       Sample Input 2 10
1 1 1 1 1 1 1 1 1      Sample Output 2 9
0
0
0
0
0
0
0
0
0       Sample Input 3 7
1 2 3 4 5 6      Sample Output 3 1
1
1
1
1
1
0

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

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

bu = [0]*(N+1)
for i in range(N-1):
  bu[a[i]]+= 1
for b in range(1,len(bu)):
  print(bu[b])

Solution (Python):
"""
Author    : co_devil Chirag Garg
Institute : JIIT
"""
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *



from fractions import Fraction

mod = 998244353


def ii(): return int(input())


def si(): return str(input())


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


def li(): return list(mi())


def fii(): return int(stdin.readline())


def fsi(): return str(stdin.readline())


def fmi(): return map(int, stdin.readline().split())


def fli(): return list(fmi())


abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}


def getKey(item): return item[0]


def sort2(l): return sorted(l, key=getKey)


def d2(n, m, num): return [[num for x in range(m)] for y in range(n)]


def isPowerOfTwo(x): return (x and (not (x & (x - 1))))


def decimalToBinary(n): return bin(n).replace("0b", "")


def ntl(n): return [int(i) for i in str(n)]


def powerMod(x, y, p):
    res = 1
    x %= p
    while y > 0:
        if y & 1:
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res


graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000


def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)


def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d


def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d


def connected_components(graph):
    seen = set()

    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component

    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans


def primeFactors(n):
    s = set()
    while n % 2 == 0:
        s.add(2)
        n = n // 2
    for i in range(3, int(sqrt(n)) + 1, 2):
        while n % i == 0:
            s.add(i)
            n = n // i
    if n > 2:
        s.add(n)
    return s


def find_all(a_str, sub):
    start = 0
    while True:
        start = a_str.find(sub, start)
        if start == -1:
            return
        yield start
        start += len(sub)


def SieveOfEratosthenes(n, isPrime):
    isPrime[0] = isPrime[1] = False
    for i in range(2, n):
        isPrime[i] = True
    p = 2
    while (p * p <= n):
        if (isPrime[p] == True):
            i = p * p
            while (i <= n):
                isPrime[i] = False
                i += p
        p += 1
    return isPrime


def dijkstra(edges, f, t):
    g = defaultdict(list)
    for l, r, c in edges:
        g[l].append((c, r))

    q, seen, mins = [(0, f, ())], set(), {f: 0}
    while q:
        (cost, v1, path) = heappop(q)
        if v1 not in seen:
            seen.add(v1)
            path = (v1, path)
            if v1 == t:
                return (cost, path)

            for c, v2 in g.get(v1, ()):
                if v2 in seen:
                    continue
                prev = mins.get(v2, None)
                next = cost + c
                if prev is None or next < prev:
                    mins[v2] = next
                    heappush(q, (next, v2, path))
    return float("inf")


def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1






def readTree(n):
    adj = [set() for _ in range(n)]
    for _ in range(n-1):
        u, v = map(int, input().split())
        adj[u-1].add(v-1)
        adj[v-1].add(u-1)
    return adj


def treeOrderByDepth(n, adj, root=0):
    parent = [-2] + [-1]*(n-1)
    ordered = []
    q = deque()
    q.append(root)
    depth = [0] * n
    while q:
        c = q.popleft()
        ordered.append(c)
        for a in adj[c]:
            if parent[a] == -1:
                parent[a] = c
                depth[a] = depth[c] + 1
                q.append(a)
    return (ordered, parent, depth)














n = ii()
l = li()
out = [0]*(n+1)
for i in l:
    out[i] += 1
for i in range(1, (n+1)):
    print(out[i])

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

ans = {i: 0 for i in range(n)}

for i in range(n-1):
    ans[A[i]-1] += 1
for k, v in ans.items():
    print(v)

Solution (Python):
from collections import Counter

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

c = Counter(A)
for i in range(1, N+1):
    if i in c.keys():
        print(c[i])
    else:
        print(0)

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

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    arr = [int(x) - 1 for x in input().split()]
    res = [0 for _ in range(N)]
    for elem in arr:
        res[elem] += 1
    for ans in res:
        print(ans)

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

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

ans = [0]*N

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

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

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

n = ii()
a = iin()
l = [0 for i in range(n)]
for i in a:
    l[i-1] += 1
for j in l:
    print(j)

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

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

for i in ans:
    print(i)

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

Solution (Python):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    R = [[] for _ in range(N + 1)]
    for i, a in enumerate(A, 2):
        R[a].append(i)
    print('\n'.join(str(len(i)) for i in R[1:]))
main()

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

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

ans = {}
for i in range(n-1) :
  if a[i] in ans :
    ans[a[i]] += 1
  else :
    ans[a[i]] = 1
    
for i in range(1,n+1) :
  if i in ans :
    print(ans[i])
  else :
    print(0)

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

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

for d in c:
    print(d)

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)  
to_index = lambda x: int(x) - 1  
print_list_in_2D = lambda x: print(*x, sep="\n")  


def input_int(): return int(input())

def map_int_input(): return map(int, input())

MII = map_int_input

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

def MII_to_index(): return map(to_index, input())

def MII_split_to_index(): return map(to_index, input().split())


def list_int_inputs(): return list(map(int, input()))

LII = list_int_inputs

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


def LII_2D(rows_number): return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number): return [LII_split() for _ in range(rows_number)]

N = int(input())
As = LII_split()

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

for A in As:
    subordinates[A-1] += 1

print_list_in_2D(list(subordinates.values()))

Solution (Python):

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

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

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

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

for b in B:
    print(b)

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




import sys
input = sys.stdin.readline



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

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

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

    for i in b:
        print(i)



main()

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

AList = list(map(int, input().split()))
ResultList = [0 for i in range(N)]
for i in range(N - 1):
    ResultList[AList[i] - 1] += 1

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

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

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

l = [0]*N

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

[print(i) for i in l]

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

N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
k = set(A)
r = set(range(1, N + 1))

for key in r - k:
    c[key] = 0


for key in r:
    print(c[key])

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

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 val in a:
    res[val-1] += 1
for i in range(N):
    print(res[i])

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

junior = [0] * N

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

for j in junior:
    print(j)

Solution (Python):


from pprint import pprint
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.buffer.readline

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

ans = [0 for _ in range(n)]
for a_i in a:
    ans[a_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 i in range(n):
  print(x[i])

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

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

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

for i in b:
    print(i)

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

B_list = [0] * N

for i in range(N-1):
    B_list[A_list[i] - 1] += 1

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

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

a_result = [0] * n

for i in range(n-1):
    upper = a_l[i]-1
    a_result[upper] += 1

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

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

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

Boss = { i: 0 for i in range(N)}
for a in A:
    Boss[a-1] += 1

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

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

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

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

for a in ans:
    print(a)

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

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 x in range(1,n+1):
    print(c[x])

Solution (Python):
import collections

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

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

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

Solution (Python):
import sys
import collections

def set_debug(debug_mode=False):
    if debug_mode:
        fin = open('input.txt', 'r')
        

        sys.stdin = fin
        


if __name__ == '__main__':
    

    n = int(input())

    res = list(map(int, input().split()))
    nei = collections.defaultdict(list)
    for i, x in enumerate(res, 2):
        nei[x].append(i)

    q = collections.deque()
    q.append(1)

    count = [0] * (len(res)+1)

    while q:
        for _ in range(len(q)):
            cur = q.popleft()
            for x in nei[cur]:
                count[cur-1] += 1
                q.append(x)
                
    for x in count:
        print(x)

Solution (Python):
from collections import Counter
n = int(input())
a_inputs = [int(i)-1 for i in input().split()]

a_dic = Counter(a_inputs)
for i in range(n):
    print(a_dic[i])

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

Solution (Python):
import collections

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

    c = collections.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()))

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

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

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

Solution (Python):
from math import *
from collections import *
test = 1

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

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

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

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

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

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

Solution (Python):
from collections import defaultdict
n = int(input())
A=[int(i) for i in input().split()]
dd=defaultdict(int)
for a in A:
    dd[a]+=1

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

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

Solution (Python):
import collections

n = int(input().strip())

arr = list(map(int, input().strip().split()))

counts = collections.Counter(arr)

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

Solution (Python):


N = int(input())




A = [int(x) for x in 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):
from collections import Counter
N = int(input())
A = [int(x) for x in input().split()]
AC = Counter(A)

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

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

P = [[] for _ in range(N)]
for i in range(N-1):
    jousi = A[i]-1
    P[jousi].append(i+1)

for v in P:
    print(len(v))

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

Solution (Python):
import collections

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

C = collections.Counter(A)

for i in range(N):
    if C.get(i+1) is not None:
        print(C[i+1])
    else:
        print(0)

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

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

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

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

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

for r in res:
    print(r)

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

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

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

for s in sub:
  print(s)

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


for x in bs:
    print(x)

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

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

for i in range(n - 2, -1, -1):
    ans[a[i] - 1] += 1
for x in ans:
    print(x)

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

answer_dic={}
for a in alist:
  if a in answer_dic:
    answer_dic[a]+=1
  else:
    answer_dic[a]=1


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

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

Solution (Python):
from sys import stdin
from collections import Counter
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
c = Counter(A)
for i in range(1,N+1):
    print(c[i])

Solution (Python):
N = int(input())
a = [int(i) for i in 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 = [int(i) for i in input().split()]

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

for el in A_list:
    dic[el] += 1

for k, v in dic.items():
    print(v)

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

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

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

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

s=[]
for i in range(n):
    s.append(0)
for i in range(n-1):
    s[int(A[i])-1]+=1

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

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

Solution (Python):
LI = lambda: list(map(int,input().split()))
MI = lambda: map(int,input().split())
yes = lambda: print("YES")
no = lambda: print("NO")
I = lambda: list(input())
J = lambda x: "".join(x)
II = lambda: int(input())
SI = lambda: input()

t = int(input())
a = LI()
d = {}
for i in a:
	if i not in d:
		d[i] = 1
	else:
		d[i]+=1
for i in range(1,t+1):
	if i in d:
		print(d[i])
	else:
		print(0)

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

for a in a_list:
    ans_list[a - 1] += 1

for ans in ans_list:
    print(ans)

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

def main():
    N,*A = map(int, read().split())

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

    for e in E:
        print(e)



if __name__ == "__main__":
    main()

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

resolve()

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 input_int():
    return int(input())



def int1(x):
    return int(x) - 1



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



def input_to_int_tuple():
    return tuple(map(int, input().split()))



def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    from collections import defaultdict
    n = input_int()
    a = input_to_int_tuple()

    syain = defaultdict(int)

    for a_i, josi_no in enumerate(a):
        syain_no = a_i + 1
        syain[josi_no] = syain[josi_no] + 1

    for syain_no in range(1, n + 1):
        print(syain[syain_no])


if __name__ == "__main__":
    main()

Solution (Python):
n=input()
arr=map(int, raw_input().split())
l=[0]*(n+1)
for i in xrange(len(arr)):
    l[arr[i]]+=1

for i in xrange(1, n+1):
    print l[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):
    
    if(i in c):
        print(c[i])
    else:
        print(0)

Solution (Python):
from sys import stdin


def get_result(data):
    N = data[0][0]
    A = data[1]
    ans = [0 for _ in range(N)]
    for val in A:
        ans[val-1] += 1
    for val in ans:
        print(val)


if __name__ == '__main__':
    raw_data = [val.rstrip() for val in stdin.readlines()]
    data = [list(map(int, val.split(' '))) for val in raw_data]
    get_result(data)

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

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

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

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

B = [0 for _ in range(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_lst = [int(elem) for elem in input().split()]

import collections

c = collections.Counter(a_lst)
for i in range(1, n+1):
    if i in c.keys():
        print(c[i])
    else:
        print(0)

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

ans_list = [0] * N

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

for ans in ans_list:
    print(ans)

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


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
cntA = Counter(A)

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

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

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

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

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

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

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

c = collections.Counter(A_list)

for i in range(1,N+1):
    if c.get(i) is not None:
        print(c[i])
    else:
        print(0)

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

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

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

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

for i in R:
    print(i)

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

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

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

for i in mem:
    print(i)

Solution (Python):
def resolve():
    N = int(input())
    arr = list(map(int, input().split()))
    from collections import defaultdict
    nums = defaultdict(int)
    for num in arr:
        nums[num] += 1
    for i in range(1, N+1):
        print(nums.get(i, 0))
resolve()

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

d = {}

for i in range(N - 1):
    if A[i] in d:
        d[A[i]].append(i + 2)
    else:
        d[A[i]] = [i + 2]

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

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

Solution (Python):


def main():
     n = int(input())
     boss = list(map(int, input().split()))
     ans = [0 for i in range(n)]

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

if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict
N=int(input())
L=list(map(int,input().split()))
L.insert(0,0)
Hash=defaultdict(lambda:0)
for i in L:
    Hash[i]+=1
for i in range(1,N+1):
    print(Hash[i])

Solution (Python):

N = int(input())
A = [int(x) for x in 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 = [int(i) for i in input().split()] 

ans = [0] * N

for a in A:
  ans[a-1] += 1
  
for x in ans:
  print(x)

Solution (Python):
from collections import Counter


n = int(input())
A = Counter(list(map(int, input().split())))
for i in range(1, n + 1):
    print(A.get(i, 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 ans:
    print(i)

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

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

for x in ans:
    print(x)

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

N = int(input())

I = input().split()

Buka = [0] * N

for i in range(N-1):
    Buka[ int(I[i])-1 ] += 1

for i in range(N):
    print(Buka[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 b in B:
    print(b)

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

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

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

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

S = [0] * N

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

for s in S:
    print(s)

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

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

temp_dict = {}
for i in A_list:
    if i not in temp_dict:
        temp_dict[i] = 1
    else:
        temp_dict[i] += 1

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

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

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

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

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

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

n = int(input())
a = [int(x) for x in input().split()]
r = [0] * (n + 1)

for x in a:
    r[x] += 1

for x in r[1:]:
    print(x)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,pi
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]






n=ii()
arr=limii()
ans=[0]*n
for i in arr:
    ans[i-1]+=1
for i in ans:
    print(i)