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):
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    
    staff_list = []
    for _ in range(n):
        staff_list.append(0)
    
    for boss_index in a_list:
        staff_list[boss_index-1] += 1
    
    for staff in staff_list:
        print(staff)

if __name__ == '__main__':
    main()

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

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 sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))
B = [0]*(N+1)
for i in range(N-1):
    B[A[i]] += 1
print('\n'.join([str(n) for n in B[1:]]))

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

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

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

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

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

Solution (Python):
N = int(input())
l = [0]*N
A = [j for j in map(int, input().split())]

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

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

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(n):
    print(ans[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 numpy as np

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

worker = list(np.zeros(n, dtype=int))

for i in range(n-1):
    worker[A[i]-1] += 1

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

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

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

resolve()

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

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

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

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

member = list(map(int, input().split()))
for i in member:
    a[i].append(1)

for j in a:
    print(len(a[j]))

Solution (Python):
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n = I()
    a = list(IL())
    m = [0]*n
    for rep in a:
        m[rep-1] += 1
    for rep in m:
        print(rep)
    return

if __name__=='__main__':
    Main()

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

ans = [0]*N

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

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

lst=list(map(int,input().split(' ')))

final=[0]*n

for i in lst:
    final[i-1]+=1
print(*final, sep='\n')

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

lst=list(map(int,input().split(' ')))

final=[0]*n

for i in lst:
    final[i-1]+=1
for i in final:
    print(i)

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(1,N+1):
    print(J[i])

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

num.sort()
cnt = 0
work = 0
sum = 0
flg = 0
for i in num:
  if work != i:
    if work != 0:
      print(cnt)
      sum += 1
    cnt = 1
    mae = work + 1
    work = i
    if mae != work:
      for i in range(mae,work):
        print(0)
        sum += 1
  elif work == i:
    cnt += 1
  

print(cnt)
sum += 1
sum = int(n) - sum
for i in range(sum):
  print(0)

Solution (Python):

def main():
    n = int(input())
    a = list(map(int, input().split(' ')))
    buka = [0]*n

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

    for i in buka:
        print(i)


if __name__ == "__main__":
    main()

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

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

buka = [0] * n

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

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

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

Solution (Python):

N = int(input())
employees = list(map(int,input().split()))
bosses_num = [0]*N
for employee in employees:
    bosses_num[employee-1]+=1
for boss_num in bosses_num:
    print(boss_num)

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

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

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

for i in mem:
	print(i)

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

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

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

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

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

Solution (Python):
from collections import Counter
N = int(input())
emplist = [int(x) for x in input().split()]

ans = Counter(emplist)

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

Solution (Python):
import math
def fact(n):
    ans = 1
    for i in range(2, n+1):
        ans*= i
    return ans
def comb(n, c):
    return fact(n)//(fact(n-c)*c)

n = int(input())
b = {}
vals = list(map(int, input().split()))
for i in range(n-1):
    if(vals[i] in b):
        b[vals[i]]+=1
    else:
        b[vals[i]] = 1
for i in range(1, n+1):
    if(i in b):
        print(b[i])
    else:
        print(0)

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

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

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

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

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

for x in member:
    print(x)

Solution (Python):

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

members = [0] * n
for boss in a:
    members[boss-1] += 1
for ans in members:
    print(ans)

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

li = [0]*n

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



for j in li:
    print(j)

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

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

for j in list:
    print(j)

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

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

Ans = [0] * N

for x in range(N-1):
    Ans[A[x]-1] += 1

for x in range(N):
    print(Ans[x])

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

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

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

for i in worker:
    print(i)

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
from collections import defaultdict as ddict

B = ddict(int)
for a in A:
  B[a-1] += 1
for n in range(N):
  print(B[n])

Solution (Python):

from collections import Counter
n, *a = map(int, open(0).read().split())
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]*n

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

for i in ans:
    print(i)

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

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

for j in l:
    print(j)

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

for result in b:
  print(result)

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

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

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

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

if __name__=="__main__":
    main()

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

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

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

Solution (Python):
n = int(input())
a = [0] + [0] + list(map(int, 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):
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):
def resolve():
    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)
resolve()

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

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

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

result = [0] * n

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

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

Solution (Python):
N = int(input())
lCnt = {}
for n in range(N):
  i = n + 1
  lCnt[i] = 0
i = 2
for n in input().split():
  Ai = int(n)
  lCnt[Ai] += 1
  i += 1
for n in lCnt:
  print(lCnt[n])

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

ans = [0] * n

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

for v in ans:
    print(v)

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

res = [0]*n
for a in al:
    res[a-1] += 1

for r in res:
    print(r)

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

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

ans = [0] * (n+1)

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

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
Lis = [0]*N
for T in range(0,N-1):
    Lis[A[T]-1] = Lis[A[T]-1]+1
print('\n'.join(map(str,Lis)))

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

ans = [0]*n

for i in l:
  ans[i-1]+=1
  
for j in ans:
  print(j)

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

def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    cnt = collections.Counter(a)
    for i in range(1, n+1):
        print(cnt[i])

if __name__ == '__main__':
    main()

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

b = [0]*N

for i in A:
  b[i-1] += 1
for j in b:
  print(j)

Solution (Python):
N=int(input())
a=input().split()
A=[]
for _ in a:
    A.append(int(_))
E=[0]*(N+1)

for i in range (len(A)):
    _boss=A[i]
    E[_boss]+=1

for j in range(1,len(E)):
    print(E[j])

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


sub_num = []
for i in range(n+1):
    sub_num.append(0)


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

for i in range(1, n+1):
    print("{}".format(sub_num[i]))

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

count = [0]*n

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

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

en = [0]*N
for i in p:
    en[i-1] += 1

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

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

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

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

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

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

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

l = len(a)+1 

sub = [0] * l

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

ans = '\n'.join(map(str,sub)) 

print(ans)

Solution (Python):
n = int(input())
c = [0] * (n + 1)
for i, j in enumerate(map(int, input().split())):
    i += 2
    c[j] += 1
print(*c[1:], sep='\n')

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

Solution (Python):
import collections

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

c = collections.Counter(k)

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

Solution (Python):
N = int(input())
emp = list(map(lambda x:int(x) - 1, input().split()))
ans = [0] * N

for e in emp:
    ans[e] += 1

for i in ans:
    print(i)

Solution (Python):

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

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

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

Solution (Python):
import collections

N = int(input())

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

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

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

for d in b:
    print(d)

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

a_i_inputs = input().rstrip().split(' ')
a_i_list = [int(i) for i in a_i_inputs[:n]]

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

for a_i in a_i_list:
  output_list[a_i-1] += 1
  
for output in output_list:
  print(output)

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):
a = int(input())
b = list(map(int, input().split()))
c = [0 for f in range(a)]
for i in b:
  c[i - 1] += 1
for g in c:
  print(g)

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    men = [0 for _ in range(len(A)+1)]
    for i in range(len(A)-1, -1, -1):
        men[A[i]-1] += 1
    for m in men:
        print(m)



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

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

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

Solution (Python):
N = int(input())
A = list(input().split())
A = [int(A[i]) for i in range(N-1)]
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):
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:
    print(C[i])
  else:
    print(0)

Solution (Python):
N=int(input())
p=list(map(int,input().split()))
li=[0]*N
for mem in p:
  li[mem-1]+=1
for i in li:
  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 j in ans:
    print(j)

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

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

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

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

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

ans = [0]*(n+1)

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

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

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

Solution (Python):
def main():
  N = int(input())
  A = [int(x) for x in input().split()]
  
  B = [0] * N    
  for i in range(N-1):
      B[A[N-i-2]-1] += 1
  
  for i in range(N):
    print(B[i])
    
if __name__ == '__main__':
  main()

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

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

Solution (Python):
N = int(input())
num_subordinates = [0] * N

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

for i in my_boss:
    num_subordinates[i-1] += 1

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

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

bosses = [0]

for i in info:
    num = int(i)
    bosses[num-1] += 1
    bosses.append(0)

for item in bosses:
    print(item)

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

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

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

Solution (Python):
from collections import Counter


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

c = Counter(a)

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

Solution (Python):
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5
1 1 2 2"""
        output = """2
2
0
0
0"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """10
1 1 1 1 1 1 1 1 1"""
        output = """9
0
0
0
0
0
0
0
0
0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """7
1 2 3 4 5 6"""
        output = """1
1
1
1
1
1
0"""
        self.assertIO(input, output)


def resolve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n - 1)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    n = len(a) + 1
    boss = [0] * (n + 1)
    for b in a:
        boss[b] += 1
    return boss[1:]


def write(result):
    for r in result:
        print(r)


if __name__ == '__main__':
    
    resolve()

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

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

Solution (Python):
from heapq import heapify, heappop, heappush
N = int(input())
A = list(map(int, input().split()))
heapify(A)
for i in range(1, N + 1):
    curr_cnt = 0
    if len(A) > 0:
        temp = heappop(A)
        if i == temp:
            while i == temp and (len(A) > 0):
                curr_cnt += 1
                temp = heappop(A)
            if i == temp:
                curr_cnt += 1
            else:
                heappush(A, temp)
        else:
            heappush(A, temp)
    print(curr_cnt)

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

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

for i in manager:
    print(i)

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

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

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

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

for i in ans:
    print(i)

Solution (Python):
import collections

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

sup = [0] * N

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

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

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

Solution (Python):
import collections

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

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

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

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

boss_dict = {i+1:0 for i in range(N)}
for i in range(N-1):
    boss = A_list[i]
    boss_dict[boss] += 1

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

Solution (Python):

n = int(input())
l = list(map(int,input().split()))
l.sort()
k = 0
j = 1
cnt = 0
for i in range(n):
    if i == n-1:
        print(cnt)
        for _ in range(n - j):
            print(0)
    elif j == l[i]:
        cnt += 1
    elif l[i] - j >= 1:
        print(cnt)
        cnt = 1
        a = l[i] - j
        for _ in range(a-1):
            print(0)
        j += l[i] -j

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()))
c = [0]*(N+1)
for ai in A:
  c[ai] +=1

for i in c[1:]:
    print(i)

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

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

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

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

m = [0] * n

for i in a:
  m[i-1] += 1
  
m = map(str, m)
print('\n'.join(m))

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
memo = {key:0 for key in range(1, N+1)}

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

for key in memo.keys():
    print(memo[key])

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

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

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

sum =[0] * N

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

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

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

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

for i in A:
    S[i - 1] += 1
    
for i in S:
    print(i)

Solution (Python):
N = int(input())
A = map(int, 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()))

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

for i in A:
    S[i - 1] += 1
    
for i in S:
    print(i)

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

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

A=[0]
array=list(map(int,input().split()))
for i in range(len(array)):
    A.append(array[i]) 

for i in range(1,len(A)):
    sub[A[i]-1]+=1

for i in sub:
    print(i)

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

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

for j in x:
    print(j)

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

Solution (Python):
from collections import Counter

N = int(input())
c = Counter(map(int, input().split()))

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

[print(i) for i in b]

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

Solution (Python):
N = int(input())
boss = {i+1: 0 for i in range(N)}
A = map(int, input().split())

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

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

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

B = [0] * N
for i in A:
    B[i - 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 j in range(n):
    print(ans[j])

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

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

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

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

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

n = int(readline())
a = list(map(int, readline().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()))
boss_list = []

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

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

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

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

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

Solution (Python):
from collections import defaultdict

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

c = defaultdict(int)
for i, a in enumerate(A):
	c[a] += 1

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

Solution (Python):
import collections

num_of_employee = int(input())
employeenos = list(map(int, input().split()))

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