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())
tmp=input().split(" ")

list=[]
for i in range(N-1):
    list.append(int(tmp[i]))

answer=[0]*N

for i in range(N-1):
    answer[list[i]]+=1
answer.append(0)

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

Solution (Python):
import collections
n=int(input())
a_list=list(map(int,input().split()))
ans=[0]*n
c = collections.Counter(a_list)

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

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

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

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

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

alist = input().split(" ")

aint = []

sumlist = []

for i in range(n-1):
    aint.append(int(alist[i]))

for i in range(n):
    sumlist.append(0)

for i in aint:
    sumlist[i-1] = sumlist[i-1]+1

for i in sumlist:
    print(i)

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

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

Solution (Python):

import sys

def solve(N: int, A: "List[int]"):
    jo=[0]*N
    for i in range(N-1):
        jo[A[i]-1]+=1
    for i in range(N):
        print(jo[i])

    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 collections

N = int(input())
A = list(map(int, input().split()))
A = map(lambda x: x - 1, A)
c = collections.Counter(A)

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

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

for boss in A:
  subs[boss-1] += 1

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

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

Solution (Python):
import collections

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

cnt = collections.Counter(a_lst)  
for i in range(n):
  print(cnt[i+1])

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

Solution (Python):
import collections

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

Solution (Python):



def run():
    n = int(input())
    a = list(map(int, input().split()))[:n]
    x = [0] * (n + 1)
    for _a in a:
        x[_a] += 1
    for y in x[1:]:
        print(y)


if __name__ == '__main__':
    run()

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

Solution (Python):
from math import pi

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

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

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

    for i in d:
        print(i)

if __name__ == '__main__':
    main()

Solution (Python):
def resolve():
    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")
resolve()

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].append(i+2)
for s in ans:
  print(len(s)-1)

Solution (Python):
N = int(input())
A = [0, 0] + [int(x) for x in input().split()]

buka = [0] * (N + 1)

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

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

Solution (Python):
import sys
N = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
li1 = [0]*N
for i in li:
  li1[i-1] += 1
for i in li1:
  print(i)

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

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

"""
for i in range(1,n+1):
    print(a.count(i))
"""

S = Counter(a)

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

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

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

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

Solution (Python):
N = int(input())
menber = [0] * N
number = [int(x) for x in input().split()]

for i in range(N-1):
    menber[number[i]-1] += 1

for j in range(N):
    print(menber[j])

Solution (Python):

N = int(input())
ans = [0]*N
M = list(map(int,input().split()))
for i in M:
    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()))
ca = Counter(A)
for i in range(1, n+1):
    print(ca[i])

Solution (Python):

from sys import stdin
from operator import itemgetter
from collections import deque
from collections import Counter
import math
import pprint
from functools import reduce


def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers):
    return reduce(math.gcd, numbers)

N = int(stdin.readline().rstrip())
A = list(map(int,[int(x) for x in stdin.readline().rstrip().split()]))

A_ = Counter(A)

for i in range(1,N+1):
    print(A_[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())
s = input().split(" ")
d = {}
for w in s:
    if w in d.keys():
        d[w] += 1
    else:
        d[w] = 1

for n in range(N):
    if str(n + 1) in d.keys():
        print(d[str(n + 1)])
    else:
        print(0)

Solution (Python):

import collections
N = int(input())
A =list(map(int, input().split()))
A_n = collections.Counter(A)

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

Solution (Python):
import numpy as np
n = int(input())
r = np.zeros(n,dtype=int)
for i in input().split():
    r[int(i) - 1] += 1
for i in r:
    print(i)

Solution (Python):
emp = int(input())
boss = list(map(int, input().split()))

lis = [0] * emp

for b in boss:
  lis[b-1] += 1

for l in lis:
  print(l)

Solution (Python):
n, *aa = map(int, open(0).read().split())

from collections import Counter
ca = Counter(aa)

for i in range(1, n+1):
    have = ca[i]
    print(have)

Solution (Python):
import sys
import math
from collections import deque
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()

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

for i in ans:
  print(i)

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

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

for id in a:
	boss[id-1] += 1

for cnt in boss:
	ans = cnt
	print(ans)

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

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

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

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

a_list = list(map(int, input_line2.split()))

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

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

for c in counts:
    print(c)

Solution (Python):
n = int(input())
an = list(map(int ,input().split()))
res = [0]*n
for i,boss in enumerate(an):
    res[boss-1] += 1
print("\n".join(list(map(str ,res))))

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

print(0)

Solution (Python):
import sys
import math
n = int(input())
tmpli=list(map(int,input().split()))
li = [0]*n
for i in tmpli:
    li[i - 1] += 1
for i in li:
    print(i)

Solution (Python):
e = [0] * int(input())
v = list(map(int, input().split(" ")))

for i in v:
    e[i - 1] += 1

for i in e:
    print(i)

Solution (Python):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
c = np.zeros(n)

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

Solution (Python):
N = int(input())
li = list(map(int,input().split()))
li_ans = [0]*(len(li)+1)

for j in li:
    li_ans[j-1]+=1

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

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

for bitem in b:
    print(bitem)

Solution (Python):
n = int(input())
k = list(map(int, input().split()))
dict = {}

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

for i in k:
    dict[i] += 1

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

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

list_1 = collections.Counter(a)

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

Solution (Python):
import math


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

def solve(N, A):
    C = [0 for i in range(N)]
    for a in reversed(A):
        C[a-1] += 1
    for c in C:
        print(c)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("{}".format(outputs))

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

Solution (Python):
import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
N = int(input())
a = readints()
ans = [0]*(N+1)
for i in range(len(a)):
    ans[(a[i])] += 1
for i in range(len(ans)-1):
    print(ans[i+1])

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 j in range(N):
    print(b[j])

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = []
sp = 0
c = 0
for i in range(n + 1):
    if i == 0: continue
    for j in range(sp, n - 1):
        if a[j] != i:
            break
        sp += 1
        c += 1
    ans.append(c)
    c = 0

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

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

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

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

bukakosuu = [0]*N

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

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

Solution (Python):
'''二分探索'''

'''デック'''

'''順列,組み合わせ,累積和,直積・forネスト'''

'''小数点以下切り捨て,小数点以下切り上げ,平方根,階乗,最大公約数'''

'''input 文字列は最後に\nを含む'''




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


if __name__ == '__main__':
    main()

Solution (Python):
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import fractions
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()
A = LI()

cnt = [0] * n

sa = set(A)
csa = Counter(A)

for v in sa:
    if cnt[v-1] != 0:
        continue
    cnt[v-1] = csa[v]

for c in cnt:
  print(c)

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 numpy as np

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

counter = np.bincount(A)
ans = counter[1:].tolist()
ans.extend([0]*(N-len(ans)))
print(*ans, sep="\n")

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

Solution (Python):
N = int(input())
a = [int(x) for x in input().split()]
list = []
for i in range(N):
    list.append(0)
j = 0
for j in range(N-1):
    list[a[j]-1] +=1

for k in range(N):
    print(list[k])

Solution (Python):
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
for i in range(1, -~n):
    print(c.get(i, 0))

Solution (Python):









import os
import sys
from collections import Counter as ct


def main():
    n=int(input())
    a = list(map(int,input().split()))
    c = ct(a)
    
    for i in range(1,n+1):
        if i in c.keys():
            print(c[i])
            continue
        print(0)

if __name__ == "__main__":
    main()

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
readline = sys.stdin.readline
read = sys.stdin.read

n,*a = [int(i) for i in read().split()]
res = [0]*(n+1)
for i in a:
    res[i] += 1
print(*res[1:],sep="\n")

Solution (Python):
import copy
import math
n=int(input())
x=[list() for a in range(n)]
y=list(map(int,input().split()))
for t in y:
    x[t-1].append("a")
for s in x:
    print(len(s))

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

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

dic = {}
for i in lists:
    if i in dic.keys():
        dic[i] += 1
    else:
        dic[i] = 1

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

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

n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
boss = [0]*n

for i,j in c.items():
    boss[i-1] += j

for i in boss:
  print(i)

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

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

for i in ans[1:]:
  print(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_dict = {}
for a in a_list:
    if not(a in ans_dict):
        ans_dict[a] = 0
    ans_dict[a] += 1

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

Solution (Python):
import collections

N = int(input())

input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

c = collections.Counter(Line)

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

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


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

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

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

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

Solution (Python):
N = int(input())
nums = [int(e) for e in input().split()]
ans = []
count = []
nums.sort()
for i in range(0,N):
    count.append(0)
for i in nums:
    count[i-1] += 1
for i in range(0,N):
    print(count[i])

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

Solution (Python):
import collections

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

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

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

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

Solution (Python):
from collections import Counter

length = int(input())
data = [int(i) for i in input().split()]

c = Counter(data)

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

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

if __name__ == "__main__":
    main()

Solution (Python):
from collections import Counter

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

ct = Counter(As)

for i in range(1,n+1):
	if i in ct.keys():
		print(ct[i])
	else:
		print('0')

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

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

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

Solution (Python):
import numpy as np

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

ans=np.zeros(N)
for A in An:
    ans[A-1] += 1

for a in ans:
    print(int(a))

Solution (Python):
import collections 

N = int(input())
A = list(map(int, input().split()))
lst = set()
c = collections.Counter(A)
cnt = 0
for i in range(1, N+1):
    if(c[i] != 0):
        print(c[i])
    else:
        print(0)

Solution (Python):
a = int(input())
i = list(map(int, input().split()))
dict = {}
for num in range(a):
  dict[num] = 0

for num2 in range(len(i)):
  dict[i[num2] - 1] += 1

for num in range(a):
  print(dict[num])

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

for i in range(1,n+1):
	print(count[i],end=" ")

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

boss_nums = input()
boss_nums = boss_nums.split()

subordinate = [0] * n

for num in boss_nums:
    num = int(num)
    subordinate[num-1] += 1


for num in range(0, n):
    print(subordinate[num])

Solution (Python):
import sys
sys.setrecursionlimit(300000)
from collections import defaultdict

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()
A = LMI()

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

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

Solution (Python):
from sys import stdin,stdout

for _ in range(1):
	
	
	n=int(stdin.readline())
	a=[0,0]+list(map(int,stdin.readline().split()));sub={}
	for i in range(2,n+1):
		sub[a[i]]=sub.get(a[i],0)+1
	for k in range(1,n+1):
		stdout.write(str(sub.get(k,0))+'\n')

Solution (Python):

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

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

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

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(map(int, input().split()))

c = collections.Counter(a)

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

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

supervisor = {}

for i in arr:
    if i in supervisor:
        supervisor[i] = supervisor[i] + 1
    else:
        supervisor.update({i:1})

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

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

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

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

Solution (Python):
n= int(input())
arr = list(map(int,input().split(" ")))
d=dict()
for x in range(1,n+1):
    d[x]=0
for x in arr:
    d[x]+=1

for ele in d:
    print(d[ele])

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

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

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

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

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

  for i in A_list:
    SV[i-1] += 1
  
  for i in SV:
    print(i)


if __name__ == "__main__":
  main()

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

for i in range(n):
    print(d[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())
boss_n = map(int, input().split())

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

for i in boss_n:
    labor_dict[i] += 1
    
for i in labor_dict:
    print(labor_dict[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):
import sys
import numpy as np

n=int(sys.stdin.readline())

a=np.array(sys.stdin.readline().split(),dtype='int64')


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

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

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

    for i in res:
        print(i)


if __name__ == '__main__':
    resolve()

Solution (Python):
N=int(input())
*S,=map(int,input().split())
C=[0 for _ in range(N+1)]

for i in S:
  C[i]+=1

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

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

shain_dic = {}

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

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

for i in shain_dic:
    print(shain_dic.get(i))

Solution (Python):
import collections
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
	L.append(i+1)
S=collections.Counter(L)
S=sorted(S.items())
for x,y in S:
	print(y-1)

Solution (Python):
from collections import Counter

N=int(input())
A=list(map(int,input().split()))
B=set(A)
C=Counter(A)
for i in range(1,N+1):
  if i not in B:
    print(0)
  else:
    print(C[i])

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

Solution (Python):
from collections import Counter

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

ll = Counter(l)

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

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

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

Solution (Python):






from sys import stdin,setrecursionlimit










setrecursionlimit(10**6+1)
input=stdin.readline

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

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

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

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

for num in range(n):
    print(N[num + 1])

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

c = collections.Counter(a)

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

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

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

for i in ans:
    print(i)

Solution (Python):
def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    result = [0] * N
    for boss in A:
        result[boss-1] += 1
    for x in result:
        print(x)

if __name__ == "__main__":
    main()

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

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

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

ans = [0 for _ in range(len(a)+1)]
count = 0
for t in a:
    ans[t-1] += 1
for i in ans:
    print(i)

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

for ans in count:
  print(ans)

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

from collections import Counter

c=Counter(IDs)

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

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

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


input = sys.stdin.buffer.readline
INF = 2**62-1


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    b = Counter()
    for a in A:
        b[a] += 1

    return '\n'.join(map(str, [b[i] for i in range(1, N+1)]))


def main():
    N = read_int()
    A = read_int_n()
    print(slv(N, A))


if __name__ == '__main__':
    main()

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

list2 = []
for i in range(n):
    list2.append(0)

for i in list1:
    list2[i-1]+=1

for i in list2:
    print(i)

Solution (Python):
import collections
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
	L.append(i+1)
S=collections.Counter(L)
S=sorted(S.items())
for x,y in S:
	print(y-1)

Solution (Python):
n = int(input())
a = list(map(str,input().split()))
from collections import Counter
x = Counter(a)
for i in range(1,n+1):
    print(x[str(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 an in ans:
    print(an)

Solution (Python):
num = int(input())
a=[0*num for i in range(num)]
boss=input().split(" ")
for i in range(num-1):
  a[int(boss[i])-1]+=1
for i in range(num):
  print(a[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 collections

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


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

Solution (Python):

import collections

def main():
    *I, = map(int, open(0).read().split())
    N = I[0]
    A = I[1:]

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

main()

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

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

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

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

Solution (Python):

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

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

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
a_len = len(a)
b = [0] * (a_len + 1)

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

for shain in b:
    print(shain)

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

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

for x in lst:
    box[x] += 1

for mybuka in box[1:n+1]:
    print(mybuka)

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 not in c:
        print(0)
    else:
        print(c[i])

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

l = [0] * n

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

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

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

Solution (Python):

import collections
n = int(input()) 
l = sorted(list(map(int, input().split())))
c = collections.Counter(l)
[print(c[i]) for i in range(1, n+1)]

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

Solution (Python):
import sys


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

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

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