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

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

Solution (Python):
N = int(input())
A = [int(n) for n in input().split()]
sub = [0] * N
for index in A:
  sub[index-1] += 1
for num in sub:
  print(num)

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

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

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

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

for ans in Ans:
	print(ans)

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

Solution (Python):
n = int(input())
list1 = list(map(int,input().split()))
list2 = [0 for _ in range(n)]
for up in list1:
  list2[up-1] += 1
for num in list2:
  print(num)

Solution (Python):
N = int(input().rstrip())
l = [0 for i in range(N)]

vl = [int(i) for i in input().rstrip().split()]
for i in range(len(vl)):
    j = vl[i] - 1
    l[j] = l[j] + 1

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

Solution (Python):

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))

d = defaultdict(int)
for i in range(1, N+1):
    d[i] = 0

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

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

Solution (Python):
b = int(input())
a = list(input().split())

result = {}
for i in range(1, b+1):
    result[i] = 0
for i in range(len(a)):
    result[int(a[i])] += 1

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

Solution (Python):
from collections import defaultdict

N = int(input())
a_dict = defaultdict(int)
for i in input().split():
    a_dict[int(i)] += 1

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

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

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

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

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

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

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

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

cnt = [0] * N

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

for c in cnt:
    print(c)

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

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

Solution (Python):
num_employee = int(input())
boss_employee_ids = map(int, input().split())

boss_num_list = [0] * num_employee

for boss_employee_id in boss_employee_ids:
    boss_num_list[boss_employee_id - 1] += 1

for boss_num in boss_num_list:
    print(boss_num)

Solution (Python):
import math
import collections

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

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

    return 0

if __name__ == '__main__':
    main()

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

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

print('\n'.join(map(str, B[1:])))

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

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()))
l =[0]*N
for i in A:
  l[i-1]+=1
print(*l,sep="\n")

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

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

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

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

Solution (Python):

import sys
import collections


def solve(N: int, A: "List[int]"):
    c = collections.Counter(A)
    for i in range(1, N + 1):
        if i in c:
            print(c[i])
        else:
            print(0)
    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):
N=int(input())
n=[0]*N
for i in input().split():
    n[int(i)-1]+=1
print(*n)

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

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

        except IndexError:
            print(0)
resolve()

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

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

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

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

if __name__ == "__main__":
    main()

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

if __name__ == "__main__":
    main()

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

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

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

b = [0]*(n+2)

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

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

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())
lista=input().split()
miembros=[0]*n
for elemento in lista:
    miembros[int(elemento)-1]+=1
for elemento in miembros:
    print(elemento)

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


managelist = [0] * n



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

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

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

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

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

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

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

for i in alist:
  dp[i-1]+=1

for i in dp:
  print(int(i))

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

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

boss_list = map(int, input().split())

employee_list = [0] * n

for boss in boss_list:
	employee_list[boss - 1] += 1

for employee in employee_list:
	print(employee)

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

boss_list = map(int, input().split())

employee_list = [0] * (n)

for boss in boss_list:
	employee_list[boss - 1] += 1

for employee in employee_list:
	print(employee)

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

for ansi in ans:
    print(ansi)

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

Solution (Python):

import collections

inp = input()
N = int(inp)

inp = input().split(' ')
A = {i: int(inp[i-2]) for i in range(2, N+1)}
A[1] = None

buka = dict(collections.Counter(A.values()))


res = {i: buka.get(i, 0) for i in A.keys()}
for i in range(1, N+1):
    print(res[i])

Solution (Python):
n = int(input())
ans = {}

bosses = input().split(' ')

for id in range(n-1):
  if ans.get(bosses[id]) is None:
    ans[bosses[id]] = 1
  else:
    ans[bosses[id]] += 1
    
for id in range(n):
  if ans.get(str(id+1)) is None:
    print(0)
  else:
    print(ans.get(str(id+1)))

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

Solution (Python):

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

Solution (Python):
import sys
n = int(sys.stdin.readline().rstrip())
li = [0 for x in range(n)]
for x in sys.stdin.readline().rstrip().split():
    li[int(x) - 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 range(len(A)):
  ans[A[i]-1] += 1

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

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

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

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

Solution (Python):
count = int(input())
num_str = input().split(' ')
nums = {}

for i in range(count):
  nums[i] = 0

for num in num_str:
  nums[int(num) - 1] += 1

for num in nums:
  print(nums[num])

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

answer = [0] * (N + 1)

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

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

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

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

ans=[]
[ans.append(0) for i in range(N)]

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

Solution (Python):
X= int(input())
sum = 0
Y = [0] * int(X)
Y2 = input().split()
for i in range(0, int(X)-1):
  Y[int(Y2[i])-1] +=1

for i in range(0, int(X)):
  print(str(Y[i]))

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

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

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

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

sub = [0]*N

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

Solution (Python):
import collections

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

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

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

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

Solution (Python):
N=int(input())
A_r=list(input().split())
A=[int(x) for x in A_r]
B=[0 for i in range(N)]

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

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

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

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

count = [0] * n

for d in data:
  count[d-1] += 1

for c in count:
  print(c)

Solution (Python):
import collections

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

count = [0] * n

for d in data:
  count[d-1] += 1

for c in count:
  print(c)

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

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

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

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

Solution (Python):


N = int(input())
A = list(map(int, input().split()))
d = dict()
for i in range(1,N+1):
    d[i] = 0

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

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

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

ans = [0] * N

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

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

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

ans = [0] * N

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

for _ in ans:
    print(_)

Solution (Python):
import math

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


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    A = read_ints()
    counter = [0]*N
    for a in A:
        counter[a-1] += 1
    for c in counter:
        print(c)


if __name__ == '__main__':
    solve()

Solution (Python):
N = int(input())
lis = list(map(int,input().split()))
dic = {}
for i in range(1,N+1):
    dic[i] = 0
for j in lis:
    dic[j] += 1
for k in range(1,N+1):
    print(dic[k])

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

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

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

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

ma = [0] * N

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

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

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    N=int(readline())
    A=list(map(int,readline().split()))
    res=[0]*N
    for i in range(N-1):
        res[A[i]-1]+=1
    for i in range(N):
        print(res[i])
if __name__=="__main__":
    main()

Solution (Python):
from collections import Counter
n=int(input())
a=[int(i) for i in input().split()]
d=Counter(a)
for i in range(n):
    print(d[i+1])

Solution (Python):
N = int(input())
M = dict([(i,0) for i in range(1,N+1)])
S = [int(x) for x in input().split()]
for s in S:
    M[s] += 1
for m in M.values():
    print(m)

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

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

ans = [0] * N

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

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

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

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

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

Solution (Python):

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

ans_l = [0]*N

i = 0
while i < N-1:
  ans_l[A_l[i]-1] += 1
  i += 1

i=0
while i < N:
  print(ans_l[i])
  i += 1

Solution (Python):
import collections

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

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

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

buka_num = [0] * N 

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

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

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

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

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

Solution (Python):
import collections

N = int(input())

Ninzu = []
for x in input().split():
	Ninzu.append(int(x))

l = collections.Counter(Ninzu)

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

print(0)

Solution (Python):
import sys
import collections

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
c = collections.Counter(A)
for i in range(1, N + 1):
    print(c[i])

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

cnt = {}
for i in range(N):
    cnt.setdefault(i+1, 0)
    
for a in A:
    cnt[a] += 1
    
for i in range(1, N+1):
    print(cnt[i])

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

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

for i in mem:
    print(i)

Solution (Python):
import collections

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

c = collections.Counter(a)

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

Solution (Python):



    
count = int(input())
math = list(map(int,input().split()))
lis = [0] * count

for i in range(count - 1):
    lis[math[i] - 1] += 1
    
for j in range(count):
    print(lis[j])

Solution (Python):
import numpy as np

N = int(input())
A = np.array(input().split()).astype(int)


res = np.zeros(N).astype(int)
for i in range(N-1):
    res[A[i]-1] += 1
for i in range(N):
    print(res[i])

Solution (Python):

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

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

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

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

result = [0] * N



for i in range(N-1):
    
    result[list[i]-1] = result[list[i]-1] + 1 



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

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

c = cl.Counter(a)

print(c[1])
for i, _ in enumerate(a):
  print(c[i+2])

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

c = cl.Counter(a)

print(c[1])
for i, _ in enumerate(a):
  print(c[i+2])

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

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

Solution (Python):


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

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

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

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

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




M = {}
for a in A:
    M[a] = M.get(a,0) + 1

for n in range(N):
    print(M.get(n+1,0))

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

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

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

B = [0] * N

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

Solution (Python):

N=int(input())
A=[0,0]
A[2:]=[int(x) for x in input().split()]
dict1={}
for i in range(2,N+1):
    tmp=str(A[i])
    if (not tmp in dict1):
        dict1[tmp]=1
    else:
        dict1[tmp]+=1
for i in range(1,N+1):
    if (str(i) in dict1):
        print(dict1[str(i)])
    else:
        print(0)

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

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

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

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

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

for j in ans:
    print(j)

Solution (Python):
import sys

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


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

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

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

for i in funcionarios:
    frequencia[i-1] += 1

for i in frequencia:
    print(i)

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

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

Solution (Python):
n = int(input())
num_list = [0] * n
for boss in input().split(' '):
    num_list[int(boss) - 1] += 1
for num in num_list:
    print(num)

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

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

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

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

Solution (Python):
if __name__ == '__main__':
    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()))
L = [0] * (n + 1)
for a in A:
    L[a] += 1

for l in L[1:]:
    print(l)

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

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

for boss in boss_list:
    l[boss-1] += 1

for ll in l:
    print(ll)

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

ans = [0]*N
for n in S:
    ans[n-1] += 1
for item in ans:
    print(item)

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

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


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

for c in cnt:
  print(c)

Solution (Python):
N=int(input())
A=[int(i) for i in input().split()]
AL=[[] for _ in range(N)]
for i in range(N-1):
    AL[A[i]-1].append(i+1)
for a in AL:
    print(len(a))

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

Solution (Python):
n = int(input())
dict = {}
for i in map(int, input().split(" ")):
	dict[i] = dict.get(i, 0) + 1
 
for i in range(1, n + 1):
	print(dict.get(i, 0))

Solution (Python):
from collections import Counter

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

count = Counter(data)

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

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

for num in boss_num:
	l[num-1] += 1	
for m in l: print(m)

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

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


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

for e in A[1:]:
  print(e)

Solution (Python):
from collections import Counter
n = int(input())
Al = list(input().split())
cdict = Counter(Al)
for i in range(n):
    print(cdict[str(i+1)])

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

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

Solution (Python):
import collections

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

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

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):
import  math
a=int(input())
b=[int(i) for i in input().split()]
c=[0 for i in b]
c.append(0)
for i in range(0,len(b)):
    c[b[i]-1]+=1
for i in c:
    print(i)

Solution (Python):
def main():
    from builtins import int, map, list, print
    from collections import defaultdict
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N = input_number()
    A = input_number_list()
    d = defaultdict(lambda: 0)
    for a in A:
        d[a]+=1
    for i in range(N):
        print(d[i+1])


if __name__ == '__main__':
    main()

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):
from collections import Counter
n = int(input())
s = input()
a_list = s.split()
dic =  Counter(a_list)
k = 1
while k <= n:
  print(dic[str(k)])
  k += 1

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

d = {x:0 for x in range(1, 1+N)}
for x in A:
    d[x] += 1
    
print('\n'.join(map(str,d.values())))

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
b = [0 for i 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())
a = list(map(int, input().split()))
b = [0 for i in range(n)]

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

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

Solution (Python):


a = int(input())



strs = input().split()

buka_nums = []
for i in range(a):
    buka_nums.append(0)

zyousi = []
for s in strs:
    zyousi_n = int(s)
    buka_nums[zyousi_n - 1] += 1

for i in buka_nums:
    print(i)

Solution (Python):
from collections import deque
import math; floor,ceil = math.floor,math.ceil
import sys; input = lambda: sys.stdin.readline().rstrip()
aint = lambda: int(input()); ints = lambda: list(map(int, input().split()))
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
is_even = lambda x: True if x%2==0 else False

def main():
    n = aint()
    a = ints();d = deque(a)
    buka = [0]*n
    for _ in range(n-1):
        buka[d.popleft()-1]+=1
    for num in buka:
        print(num)

if __name__ == '__main__':
    main()

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

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

for i in line:
    ans[i] += 1
for i in ans:
    print(i)

Solution (Python):
import math
from sys import *
inp=stdin.readline

zip=zip 
def linp(x):
    return list(map(int,x.split()))
def minp(x):
    return map(int,x.split())

n=int(inp())
a=linp(inp())
dic={i:0 for i in range(n)}
for i in a:
    dic[i-1]+=1
for i in range(n):
    print(dic[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()))
b = [0]*n
for i in range(n-1):
  b[a[i]-1] += 1
  
for e in b:
  print(e)

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