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 = int(input())

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

ans = [0]*n

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

for a in ans:
  print(a)

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

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

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

for i in range(2, n+1):
    cnt[a[i]] += 1

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

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

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

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

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

li = [0]*(n)

for i in range(n-1):
    li[ai[i]-1] += 1
    
for i in range(n):
    print(li[i])

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

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

sub = [0] * (n + 2)

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

for i in range(1, len(a) + 2):
    print(sub[i])

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

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

Solution (Python):
from collections import Counter as C
n,*a=map(int,open(0).read().split())
a=C(a)
for i in range(1,n+1):
    print(a[i])

Solution (Python):
def main():
    N=int(input())
    A=[int(_) for _ in input().split()]
    S=[0]*N
    for a in A:
        S[a-1]+=1
    for s in S:
        print(s)

main()

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

Solution (Python):
import math  
import bisect  
import queue  


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    cnt = {}
    for a in A:
        if a not in cnt:
            cnt[a] = 1
        else:
            cnt[a] += 1

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

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

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

Solution (Python):
from collections import Counter
n = int(input())
ans = [0]*n
s = list(map(int,input().split()))
k = dict(Counter(s))
for i in k:
    ans[i-1] = k[i]
print(*ans,sep="\n")

Solution (Python):
n = int(input())
out = [0] * n
l = map(int,input().split())
for v in l:
    out[v - 1] += 1
print('\n'.join(map(str,out)))

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

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

for n in ans:
    print(n)

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

b = [0]*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()))

res_list = [0] * N

for i in A_list:
    res_list[i-1] += 1

for i in res_list:
    print(i)

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

import collections

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

c = collections.Counter(l)

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

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

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

A = [a-1 for a in A]

A.reverse()

B = [0]*n

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

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

Solution (Python):
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    N = ir()
    A = lr()
    t = [0]*N
    for i in range(1, N):
        t[A[i-1]-1] += 1
    print(*t, sep='\n')
resolve()

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

N = int(input())

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

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

for k in cnt:
    print(k)

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

Solution (Python):
from collections import defaultdict


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


association = defaultdict(int)
for a in A:
    association[a-1] += 1


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

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

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

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

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

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

















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

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

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

sub_num = dict()
for a in A:
    if a - 1 in sub_num:
        sub_num[a - 1] += 1
    else:
        sub_num[a - 1] = 1
        
for i in range(N):
    if i in sub_num:
        print(sub_num[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] += 1
for i in ans:
    print(i)

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

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

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

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

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

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

Solution (Python):
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
cnt = Counter(a)
ans = [0]*n
for k in cnt.keys():
    ans[k-1] = cnt[k]
for i in range(n): print(ans[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):
  if x in c.keys():
    print(c[x])
  else:
    print(0)

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

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

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

    tree = [[] for _ in range(N)]
    for k, a in enumerate(A, 2):
        tree[a - 1].append(k - 1)

    ans = [len(t) for t in tree]
    return '\n'.join(map(str, ans))

print(c_management())

Solution (Python):
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()

import collections

c = collections.Counter(a)

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

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

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

dic = {}
for i in range(N):
    dic[i] = 0

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

Solution (Python):

from __future__ import division, print_function

import os
import 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 main():
    n = int(input())
    a = [int(i) for i in input().split()]

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

    print(*s, 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")


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()))
a.sort()

tmp = 0
cnt = 0
for i in range(1, n+1):
    while tmp < n-1 and a[tmp] == i:
        cnt += 1
        tmp += 1
    print(cnt)
    cnt = 0

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

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

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

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

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

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

for a in ans:
    print(a)

Solution (Python):

def resolve():
    n = int(input())
    ans = [0 for i in range(n)]
    for i in map(int, input().split()):
        ans[i-1] += 1
    [print(i) for i in ans]

if __name__ == '__main__':
    resolve()

Solution (Python):

import sys
import collections

def solve(N: int, A: "List[int]"):
    result = {k+1:0 for k in range(N)}

    for idx, a in enumerate(A):
        idx = idx + 2
        result[a] += 1
    for k, v in result.items():
        print(v)
    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):
import sys
N = int(sys.stdin.readline().rstrip())
A = list(map(int, sys.stdin.readline().rstrip().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]*n
for i in a:
    l[i-1]+=1
for i in l:
    print(i)

Solution (Python):
import sys
sys.setrecursionlimit(1000000)
import collections
def solve(N, A):
    c = collections.Counter(A)
    ans = []
    for i in range(N):
        if (i+1) not in c:
            ans.append("0")
        else:
            ans.append(str(c[i+1]))
    return "\n".join(ans)

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split(" ")))

    print(solve(N, A))

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

s = [0] * N
for i in A:
  s[i-1] += 1
else:
  for i in s:
  	print(i)

Solution (Python):

''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/input.txt"
exit $?
'''
import sys


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return map(int, sys.stdin.readline().strip().split())


def main():
    n = _i()
    a = _ia()
    ret = [0]*n
    for ai in a:
        ret[ai-1] += 1
    return "\n".join(map(str, ret))


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

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

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

[print(n) for n in ans]

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

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

for i in ans:
    print(i)

Solution (Python):
from collections import Counter

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

c = Counter()

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


for i in range(1, N + 1):
    print(c[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):
  if x in c.keys():
    print(c[x])
  else:
    print(0)

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())
arr = [int(x) for x in input().split()]
dc={}
for k in range(1,n+1):
    dc[k]=0
for item in arr:
    dc[item]+=1
for k in range(1,n+1):
    print(dc[k])

Solution (Python):

















mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    A = readInts() 
    B = [0] * (n)
    for i in range(n-1):
        a = A[i] - 1
        B[a] += 1
    print(*B,sep='\n')
if __name__ == '__main__':
  main()

Solution (Python):
n = int(input())
dic = {i:0 for i in range(1, n+1)}
for value in map(int, input().split()):
    dic[value] += 1
for i, j in sorted(dic.items(), key=lambda x: x[0]):
    print(j)

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from bisect import bisect_left
setrecursionlimit(1000000)

INF = int(1e10)
MOD = int(1e9 + 7)

def input():
    return stdin.readline()[:-1]


def main():
    from builtins import int, map
    N = int(input())
    A = list(map(int, input().split()))
    ans = [0] * (N + 1)
    for a in A:
        ans[a] += 1
    for a in ans[1:]:
        print(a)

   
if __name__ == '__main__':
    main()

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

    result_list = [0]*n

    for i in range(n-1):
        result_list[num_list[i]-1] += 1

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

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
superior = lr()
sub = [0] * (N+1)
for i in range(2, N+1):
    x = superior[i-2]
    sub[x] += 1

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

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 j in ans:
    print(j)

Solution (Python):
N = int(input())
zyousi_arr = [int(i) for i in input().split(' ')]
res_map = {}

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

for zyousi in zyousi_arr:
    res_map[zyousi] += 1

for k, v in sorted(res_map.items()):
    print(v)

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()))
ans = [0]*n
for e in A:
    ans[e-1] += 1

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

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

array = [0] * n

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

Solution (Python):
N=int(input())
*A,=map(int, input().split())
G=[[] for _ in range(N)]
for i,a in enumerate(A):
    G[a-1].append(i)
for g in G:
    print(len(g))

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

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

for a_ in a:
    staff[a_] += 1

for staff_ in staff:
    print(staff_)

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

x = [0] * n
for i in a:
    x[i-1] += 1
for xx in x:
    print(xx)

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

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

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

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

for aaa in ans:
  print(aaa)

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

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

for i in b:
    print(i)

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

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

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

for j in a:
  l[j] += 1

for k in range(1,n+1):
  print(l[k])

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

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())
lst1 = list(map(int,readline().split()))

lst2 = [0]*n

for i in range(n-1):
    lst2[lst1[i]-1] += 1

for i in lst2:
    print(i)

Solution (Python):




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

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

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

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

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 collections
n = int(input())
a = [int(i) for i in input().split()]

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

Solution (Python):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
p = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    n = ni()
    a = nl()

    ans = [0]*n

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

    for value in ans:
        print(value)

if __name__ == '__main__':
    main()

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

buka = {}
for a in A:
  if a in buka:
    buka[a] += 1
  else:
    buka[a] = 1

for i in range(N+1)[1:]:
  if i in buka:
    print(buka[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]+=1
for i in ans:
  print(i)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ans=[0]*n
    a=LIST()
    for i in a:
        ans[i-1]+=1
    
    for i in ans:
        print(i)
if __name__ == '__main__':
    do()

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 = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for x in a: ans[x-1] += 1
print(*ans, sep="\n")

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

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

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

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

Solution (Python):
from collections import defaultdict
n = int(input())
al = list(map(int, input().split()))
d = defaultdict(lambda: 0)
for i, a in enumerate(al):
    d[str(a-1)] += 1
for i in range(n):
    print(d[str(i)], sep=' ')

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

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

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

for b in B:
    print(b)

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

B=[0]*N

for i in range(N-1):
    B[A[i]-1]+=1
print("\n".join([str(i) for i in B]))

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

counts = [0] * N

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

print(*counts)

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

def s_in():
    return input()

def n_in():
    return int(input())

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

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

n = n_in()
A = l_in()

from collections import Counter

c = Counter()
for a in A:
    c[a] += 1

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

Solution (Python):
import math

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

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


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(a, b):
    return a * b // gcd (a, b)





N = inputI()
A = inputIL()

dic = [0]*N

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

for i in dic:
  print(i)

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

result = [0] * N

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

for r in result:
    print(r)

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()))
X = [0]*N
for a in A:
    X[a-1]+=1
for x in X:
    print(x)

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

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

anss = [0] * n

for a in aes:
  anss[a - 1] += 1

for ans in anss:
  print(ans)

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

ans = [0] * (N + 1)

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

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

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

cnt = Counter(a)


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

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


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

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

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

Solution (Python):

import numpy as np
import math
from functools import reduce


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

num_buka = np.zeros(n)
for _a in a:
    num_buka[_a-1] += 1

for e in num_buka:
    print(int(e))

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

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

a = [i-1 for i in a]
di = [0 for _ in range(n)]

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

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