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

from sys import stdin


def solve(tc):
    n = int(stdin.readline().strip())
    ai = list(map(int, stdin.readline().split()))

    adj = [[] for i in range(n)]
    for i in range(n - 1):
        adj[ai[i] - 1].append(i + 1)

    for children in adj:
        print(len(children))



LOCAL_TEST = not __debug__
if LOCAL_TEST:
    infile = __file__.split('.')[0] + "-test.in"
    stdin = open(infile, 'r')

tcs = 1
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

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

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

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

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

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

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    b = [0] * N
    for a in A:
        b[a-1] += 1
    return b



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)]  
    print(*solve(N, A), sep='\n')

if __name__ == '__main__':
    main()

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

jyoshi=[0]*n
for i in range(n-1):
  jyo=a[i]
  jyoshi[jyo-1]=jyoshi[jyo-1]+1
  
for k in jyoshi:
  print(k)

Solution (Python):
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    ret = [0] * N
    for a in A:
        ret[a - 1] += 1
    print(*ret, sep="\n")


if __name__ == '__main__':
    main()

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

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

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

for i in ans:
    print(i)

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

S = [0] * N

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


for count in S:
  print(count)

Solution (Python):
def calc(N, A):
    d = {i + 1: 0 for i in range(N)}
    for a in A:
        d[a] += 1
    return '\n'.join([str(d[k]) for k in d])


N = int(input())
A = [int(s) for s in input().split()]
print(calc(N, A))

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

input = sys.stdin.readline


def solve():
    n = int(input())
    A = map(int, input().split())
    count = [0 for _ in range(n)]
    for a in A:
        count[a-1] += 1
    return '\n'.join(map(str, count))


if __name__ == '__main__':
    answer = solve()
    print(answer)

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

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

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

Solution (Python):

import sys
import math
import numpy as np

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

ans = [0] * n

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

for x in ans :
    print(x)

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

a = list()
for i in range(n):
  a.append(0)


b = [int(e) for e in input().split()]

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

for i in a:
  print(i)

Solution (Python):
from collections import Counter
N = int(input())
List = [int(i) for i in input().split(" ")]
emp = [0]*N
Con = Counter(List)
for i in Con:
    emp[i-1] = Con[i]
    
for e in emp:
    print(e)

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

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

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

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

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

Solution (Python):
import numpy as np

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

sub = np.bincount(A, weights=None, minlength=N+1)

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

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

ans = [0] * n

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

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

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

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

ans = [0]*N

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

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

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

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

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

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

for i in syain:
    print(i)

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

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

count = []
for i in range(len(A)+1):
    count.append(0)
for i in range(len(A)):
    count[A[i]-1] += 1

for i in count:
    print(i)

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

import numpy as np
import math
B = np.zeros(N)

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

for i in range(N):
  print(math.floor(B[i]))

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

Solution (Python):
n=int(input())
m=list(map(int,input().split(" ")))
dic={}
dic[1]=1
for i in range(n):
    dic[i+1]=0
for mm in m:
    dic[mm]+=1
for value in dic.values():
    print(value)

Solution (Python):
from collections import Counter

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

    [print(cntA[i]) for i in range(1, N)]
    print(0)

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

result = [0] * n

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

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

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

supervision_num_list = [0] * n

for i in a_list:
    supervision_num_list[i-1] += 1

for num in supervision_num_list:
    print(num)

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

sub_nums = [0] * n
for a in a_list:
    sub_nums[a - 1] += 1

print("\n".join(map(str, sub_nums)))

Solution (Python):
def management():
    N=int(input())
    static_list=list(map(int,input().split()))
    result_list=[]
    for i in range(0,N):
        result_list.append(0)
    for i in range(0,len(static_list)):
            result_list[static_list[i]-1]=result_list[static_list[i]-1]+1
    for i in range(0,N):
        print(result_list[i])


if __name__=="__main__":
    management()

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

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


DATA = """
5
1 1 2 2
""".split("\n")

def get_debug_line():
	for i in DATA:
		yield i

if 1:
	get_line = input
else:
	get_line = get_debug_line().__next__
	get_line()

N = int(get_line().strip())

Memo = [0] * (N+1)
for i in get_line().strip().split(" "):
    i = int(i)
    Memo[i] += 1    

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

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


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

for j in e:
    print(str(j))

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

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

ans=[0]*n

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

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):
a = int(input())
ar = list(map(int,input().split(" ")))
br = [0 for i in range(a)]
for r in ar:
    br[r-1] += 1
for r in br:
    print(r)

Solution (Python):
N=int(input())
A=[int(x) for x in input().rstrip().split()]
cnt=[0 for x in range(N)]
for i in A:
  cnt[i-1]+=1


for i in cnt:
  print(i)

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

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

for j in ans:
    print(j)

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

result = [0] * n


for i in numlist:
	result[i - 1] = result[i - 1] + 1

for j in range(len(result)):
	print(result[j])

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

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

A_dict = {}

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

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

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

Solution (Python):
if __name__ == '__main__':
	N = int(input())
	countlist = [0] * N
	queri = [int(a) for a in input().split()]
	for q in queri:
		countlist[q-1] += 1
	for v in countlist:
		print(v)

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
m = dict()
for i in a:
  m[i] = m.get(i,0) + 1
for i in range(1,n+1):
  print(m.get(i,0))

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

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

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

a = [0]*N

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

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

c = collections.Counter(a)

a.insert(0, 0)

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

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

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

line = list(map(int, input().strip().split(" ")))

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

for i in line:
    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):
N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 1])

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

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

Solution (Python):

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

if __name__ == "__main__":
    main()

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

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

Solution (Python):


import math

deg = [0] * 200005
n=int(input())
ar = list(map(int, input().split()))

for i in range(n-1):
    deg[ar[i]] = deg[ar[i]] + 1

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

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

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

for a in A:
  res[a-1] += 1
  
for r in res:
  print(r)

Solution (Python):

from collections import Counter

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


count_dict = Counter(a_list)
for i in range(1,n+1):
    print(count_dict[i])

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

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

for i in B:
    print(i)

Solution (Python):
from collections import defaultdict

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

d = defaultdict(int)

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

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

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

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

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

for j in l:
    print(j)

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

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

staff = dict()
staff[1] = 0

for i, a in enumerate(Ali, 2):
    staff[i] = 0
    staff[a] += 1

for j in range(1,n+1):
    print(staff[j])

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

sub_nums = [0] * n
for a in a_list:
    sub_nums[a - 1] += 1

for sub_num in sub_nums:
    print(sub_num)

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

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

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

cnt = [0 for _ in range(N + 1)]

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

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

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

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

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

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

for br in range(N):
    print(T[br])

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

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

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

count = [0] * (N + 1)

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

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

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

l = [0]*n

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

for i in l:
    print(i)

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

buka = [0] * (n + 1)

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

for t in buka[1:]:
    print(t)

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

f=[0 for i in range(n)]
for i in input().split():
  f[int(i)-1]+=1
print(*f)

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={}

for x in a:
    if x in ans.keys():
        ans[x] += 1
    else:
        ans[x]=1

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

Solution (Python):
EN = input().split()
Bc = [0] * int(EN[0])

tmp = input().split()
BossN = [int(s) for s in tmp]

for i in BossN:

    Bc[i-1] = Bc[i-1] + 1

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

Solution (Python):
EN = input().split()
Bc = [0] * int(EN[0])

tmp = input().split()

for i in tmp:
    BossN = int(i)
    Bc[BossN-1] = Bc[BossN-1] + 1

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

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

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

junior_count_list = [0] * n

for boss in boss_No_list:
  junior_count_list[boss - 1] += 1

for junior in junior_count_list:
  print(junior)

Solution (Python):
n = int(input())
a = input().split()
ans = [0] * n
for i in range(n-1):
    ans[int(a[i])-1] +=1
for i in ans:
    print(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(map(int, input().split()))
num = [0 for i in range(N)]
for i in A:
    num[i-1] += 1
for l in num:
    print(l)

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

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

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

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

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

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

d = {}

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

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

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

Solution (Python):


def main():
    N = int(input())
    A = tuple(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])

if __name__ == '__main__':
    main()

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

for j in a:
  print(j)

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

Solution (Python):
N = int(input())
An = [int(x) for x in input().split()]

mylist = [0] * N

for i in An:
    mylist[i-1] = mylist[i-1] + 1

for i in mylist:
    print(i)

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

def count(N,A,Ansbox):

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

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

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

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

h = {}

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


for j in range(N-1):
    h[A[j]] += 1


for val in h.values():
    print(val)

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

for bukaninzu in bukaninzu_list:    
    print(bukaninzu)

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

for BossNum  in BossNumsList :
  SubNumsList[BossNum-1] += 1

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

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

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

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

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

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

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

Solution (Python):
len = int(input())
result = [0 for _ in range(len)]
nums = map(lambda x: int(x), input().split(' '))
for num in nums:
  result[num - 1] = result[num - 1] + 1
print(' '.join([str(n) for n in result]))

Solution (Python):
import collections
n,h = int(raw_input()),collections.Counter(map(int, raw_input().split(' ')))
for u in range(1, n+1): print h[u]

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

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

print('\r'.join(map(str, ary)))

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

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

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

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

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

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

Solution (Python):
from collections import Counter

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

cnt = Counter(A)
for i in range(N):
  print(cnt.get(i+1, 0))

Solution (Python):
from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
d = Counter(a)


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

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

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

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

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

for i in id:
	print(i)

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

Solution (Python):
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
counter = np.bincount(A)
for i in range(1, N+1):
    if i < len(counter):
        print(counter[i])
    else:
        print(0)

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

res = [0] * n

for i in hito:
  res[i - 1] += 1
for i in res:
  print(i)

Solution (Python):
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
counter = np.bincount(a)
for i in range(1, n+1):
    if i < len(counter):
        print(counter[i])
    else:
        print(0)

Solution (Python):







inputs: list = []
while True:
    try:
        inputs.append(input().strip('\n'))
    except EOFError:
        break


n: int = int(inputs[0])
workers: list = [int(w) for w in inputs[1].split(' ')]

w_list: dict = {n: 0 for n in range(1, n+1)}

for worker in workers:
    w_list[worker] += 1

print(*w_list.values(), sep='\n')

Solution (Python):
N = int(input())
from collections import Counter as C
l = dict(C((int(x) for x in input().split())))
for x in range(1,N+1):
    print(l.get(x,0))

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

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


A=list(map(int, input().split()))
B=list([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(n):
    print(c[i+1])

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

Solution (Python):
human_num = int(input())
jousi_num = [0 for i in range(human_num)]

nyu = list(map(int, input().split(" ")))

for k in nyu:
    jousi_num[k - 1] += 1

for ri in jousi_num:
    print(ri)

Solution (Python):
def main():
    N = int(input())
    a = list(map(int, input().split()))
    
    ans = {i:0 for i in range(1,N+1)}
    for i in a:
        ans[i] += 1
    for i in ans.values():
        print(i)
    
if __name__ == "__main__":
    main()

Solution (Python):
human_num = int(input())
jousi_num = [0 for i in range(human_num)]

nyu = list(map(int, input().split(" ")))

for k in nyu:
    jousi_num[k - 1] += 1

for ri in jousi_num:
    print(ri)

Solution (Python):
import sys
def inpl(): return list(map(int, sys.stdin.readline().split()))

N = int(input())

x = inpl()
y = [0]*N
for i in range(0, N-1):
    y[x[i] - 1] += 1

for i in range(0, N):
    print(y[i])

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

ans = [0]*N

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

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

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

Solution (Python):
import sys
import math
from collections import deque
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def S(): return sys.stdin.readline()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h,w): return [[i for j in range(w)] for k in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)

MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**6+10)
input = sys.stdin.readline

N = I()
up_l = LI()
under_l = [0 for i in range(N)]
for i in up_l:
    under_l[i-1] += 1
[print(i) for i in under_l]

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

staff = [0]*N
A = list(map(int,input().split()))

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

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

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

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

Solution (Python):
import collections

N = int(input())
A_list = list(map(int, input().split()))
A_collection = collections.Counter(A_list)

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

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

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

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

for i in ct_a:
    print(i)

Solution (Python):
employees = int(input())
boss_array = input().split(' ') 

counter = {}
for idx in range(1, employees+1):
    counter[str(idx)] = 0;

for boss_id in boss_array:
    counter[boss_id] = counter[boss_id] + 1

for idx in range(1, employees+1):
    print(counter[str(idx)])

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

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

Solution (Python):
def solve(n, a):
    D = {i: 0 for i in range(1, n+1)}
    for x in a:
        D[x] += 1
    for i in range(1, n+1):
        print(D[i])

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

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

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

Solution (Python):
from collections import Counter
def main():
  N=int(input())
  A=list(map(int,input().split()))
  d=Counter(A)
  for i in range(1,N+1):
    if i not in d:
      print(0)
    else:
      print(d[i])
if __name__=='__main__':
  main()

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

res=[0]*n

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

for i in res:
    print(i)

Solution (Python):
from collections import Counter
n =int(input())
a = list(map(int, input().split()))
s = Counter(a)
ans = [0] * n
for k, v in s.items():
    ans[k - 1] = v
for i in ans:
    print(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):
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):
if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))

    bosses = [0]*N
    for a in As:
        bosses[a-1] = bosses[a-1] + 1
    
    print("\n".join(map(str, bosses)))