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):
import numpy as np

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

boss=[0]*N

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

Solution (Python):
from collections import defaultdict


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

    boss_dict = defaultdict(int)
    for i in a:
        boss_dict[i] += 1
    
    for i in range(1, N + 1):
        print(boss_dict[i])



if __name__ == "__main__":
    main()

Solution (Python):
from collections import Counter

N, *A = map(int, open(0).read().split())

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

Solution (Python):
N = int(input())
arr = [int(s) for s in input().split()]
F = dict()
for i in range(N-1):
    if arr[i] in F.keys():
        F[arr[i]] += 1
    else:
        F[arr[i]] = 1
for i in range(1, N+1):
    if i in F:
        print(F[i])
    else:
        print(0)

Solution (Python):
import numpy as np

N = int(input())
A = list(map(int, input().split()))
a = np.zeros(N)
for p in A:
    a[p-1] += 1

for i in range(N):
    print(int(a[i]))

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

for i in [int(x) for x in input().split()]:
  G[~-i]+=1

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

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

s = dict.fromkeys([int(n) for n in range(1,n+1)], 0)

for i in c:
    s[i] = s[i] + 1

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

Solution (Python):
N = int(input())
A = []
B = [0 for i in range(N)]
j = 0
A = list(map(int,input().split()))
list.sort(A)
T = A[0]
for i in range(N-1):
    if A[i] != T and i != N-2:
        B[T-1] = i - j
        T = A[i]
        j = i
    elif i == N-2:
        if A[i] == T:
            B[T-1] = i - j + 1
        else:
            B[T-1] = i - j
            B[A[i]-1] = 1
for i in range(N):
    print(B[i])

Solution (Python):
def main():
    N = int(input())
    Boss = [int(a) for a in input().split()]
    count = [0]*N

    for i in range(N-1):
        count[Boss[i] - 1] += 1
    for i in range(N):
        print(count[i])
if __name__ == "__main__":
    main()

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

di = {}

for i in A:
    if i in di:
        di[i] += 1
    else:
        di[i] = 1

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

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

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

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

S = [0]*(N+1)

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

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

Solution (Python):
size = int(input())
li = list(map(int,input().split()))
"""ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)
"""
from collections import Counter
c1 = Counter(li)
ans2 = [0] * size
for i,j in c1.items():
    ans2[i-1] = j
for i in ans2:
    print(i)

Solution (Python):
from sys import stdin,stdout
size = int(stdin.readline())
li = list(map(int,stdin.readline().split()))
"""ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)
"""
from collections import Counter
c1 = Counter(li)
ans2 = [0] * size
for i,j in c1.items():
    ans2[i-1] = j
for i in ans2:
    stdout.write(str(i)+"\n")

Solution (Python):
from sys import stdin,stdout
size = int(stdin.readline())
li = list(map(int,stdin.readline().split()))
"""ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)
"""
from collections import Counter
c1 = Counter(li)
ans2 = [0] * size
for i,j in c1.items():
    ans2[i-1] = j
for i in ans2:
    stdout.write(str(i)+"\n")

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

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

for v in A:
    sub_nums[v-1] += 1

for v in sub_nums:
    print(v)

Solution (Python):
import math
N=input()
A=list(map(int, input().split()))
N=int(N)
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()))
nums = [0] * n

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

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

Solution (Python):
import numpy as np
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

N = int(input())
A = np.array(list(map(int, input().split())))
B = np.zeros(N+1, dtype = np.int64)

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

for b in B[1:]:
	print(b)

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

Solution (Python):
n = int(input())
num_under = [0 for i in range(n)]
boss = [int(i) - 1 for i in input().split(" ")]
for i in boss:
    num_under[i] += 1
for i in num_under:
    print(i)

Solution (Python):
from collections import Counter
n = int(input())
number = list(map(int,input().split()))
number_dic = Counter(number)
for i in range(n):
    if i+1 in number_dic.keys():
        print(number_dic[i+1])
    else:
        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):
import numpy as np

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

B = np.zeros(N+1)

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

for b in B[1:]:
    print(int(b))

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



def main():
    from collections import Counter
    import sys
    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
from collections import defaultdict

n = int(input())
a = [int(m) for m in input().split()]
n_buka = defaultdict(int)  


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

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

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

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

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

result = [0]*N

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

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

Solution (Python):
import sys
input = sys.stdin.readline
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):
import collections
 
N = int(input())
A = list(map(int,input().split()))
a = collections.Counter(A)
 
for i in range(N):
  print(a[i+1])

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

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

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

Solution (Python):
import os

def main():
	n = int(input())
	a_list = list(map(int, input().split()))
	result = [0]*n
	for i in a_list:
		result[i-1] += 1
	for i in result:
		print(i)

if __name__ == "__main__":
	main()

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

Solution (Python):
num_sub  = int(input())
sub_boss = input().split()

num_boss = [0]*(num_sub)

for i in sub_boss:
	num_boss[int(i)-1] += 1

for i in num_boss:
	print(i)

Solution (Python):
num = int(input())
boss = input().split()

ans_list = [0] * num

for i_boss in boss:
    ans_list[int(i_boss)-1] += 1
a = list(map(lambda  x: str(x), ans_list))
print('\n'.join(a))

Solution (Python):
社員数 = int(input())
部下数 = [0] * (社員数 + 1)

for 上司 in map(int, input().split(' ')):
    部下数[上司] += 1

print('\n'.join(map(str, 部下数[1:])))

Solution (Python):
def main():
    N = int( input())
    A = list( map( int, input().split()))
    B = [0]*(N)
    for a in A:
        B[a-1] += 1
    print("\n".join( map( str, B)))
if __name__ == '__main__':
    main()

Solution (Python):
def main():

    num = int(input())
    boss = input().split()

    ans_list = [0] * num
    
    for i_boss in boss:
        
        ans_list[int(i_boss)-1] += 1
    a = list(map(lambda  x: str(x), ans_list))
    print('\n'.join(a))


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    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:])))
if __name__ == '__main__':
    main()

Solution (Python):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in map(int, input().split(' ')):
    部下数[上司-1] += 1

print('\n'.join(map(str, 部下数)))

Solution (Python):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in map(int, input().split()):
    部下数[上司-1] += 1

[print(_) for _ in 部下数]

Solution (Python):
def main():

    num = int(input())
    boss = input().split()

    ans_list = [0] * num
    
    for i_boss in boss:
        
        ans_list[int(i_boss)-1] += 1
    a = list(map(lambda  x: str(x), ans_list))
    print('\n'.join(a))


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):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in map(int, input().split()):
    部下数[上司-1] += 1

print('\n'.join([str(_) for _ in 部下数]))

Solution (Python):
num_sub  = int(input())
sub_boss = input().split()

num_boss = [0]*(num_sub)

for i in sub_boss:
	i = int(i)
	num_boss[i-1] = num_boss[i-1] + 1

for i in num_boss:
  print(i)

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

belong_map = {}

belongings = [int(x) for x in input().split(' ')]

for b in belongings:
    if b - 1 in belong_map:
        belong_map[b - 1] += 1
    else:
        belong_map[b - 1] = 1

for i in range(members_count):
    if i in belong_map:
        print(belong_map[i])
    else:
        print(0)

Solution (Python):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in map(int, input().split()):
    部下数[上司-1] += 1

print('\n'.join(map(str, 部下数)))

Solution (Python):
a = int(input())
b = [0] * a

for c in map(int, input().split()):
    b[c-1] = b[c-1] + 1

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

Solution (Python):
a = int(input())
b = [0] * a

for c in map(int, input().split()):
    b[c-1] += 1

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

Solution (Python):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in input().split(' '):
    部下数[int(上司)-1] += 1

print('\n'.join(map(str, 部下数)))

Solution (Python):
n = int(input())
a_list = [int(i) for i in input().split()]
nl = [0] * n
for a in a_list:
    nl[a-1] += 1
for v in nl:
    print("{}".format(v))

Solution (Python):

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

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

Solution (Python):
n = int(input())
a_list = map(int, input().split())
nl = [0] * n
for a in a_list:
    nl[a-1] += 1
for v in nl:
    print("{}".format(v))

Solution (Python):
n = int(input())
a_list = map(int, input().split())
nl = {str(i):0 for i in range(n)}
for a in a_list:
    nl[str(a-1)] += 1
for v in nl.values():
    print("{}".format(v))

Solution (Python):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in map(int, input().split(' ')):
    部下数[上司-1] += 1

[print(部下) for 部下 in 部下数]

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

Solution (Python):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in map(int, input().split(' ')):
    部下数[上司-1] += 1

for 部下 in 部下数:
    print(部下)

Solution (Python):
社員数 = int(input())
部下数 = [0] * 社員数

for 上司 in map(int, input().split(' ')):
    部下数[上司-1] += 1

print('\n'.join(map(str, 部下数)))

Solution (Python):
num_employee = int(input())
num_subordinate = [0] * num_employee

for boss in map(int, input().split(' ')):
    num_subordinate[boss-1] += 1

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

Solution (Python):
n = int(input())
a_list = [int(i) for i in input().split()]
nl = {str(i):0 for i in range(n)}
for a in a_list:
    nl[str(a-1)] += 1
for v in nl.values():
    print("{}".format(v))

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):
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 = [int(a) for a in input().split()]
x = [0] * N

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

for i in x:
    print(i)

Solution (Python):
n = int(input())
a_list = [int(i) for i in input().split()]
nl = [0 for i in range(n)]
for a in a_list:
    nl[a-1] += 1
for i in nl:
    print("{}".format(i))

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

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

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

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

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

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

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

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

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

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

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

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

for i in ans:
  print(i)

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

result = [0] * N

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

for i in result:
    print(i)
    print('\n')

Solution (Python):
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    n = I()
    a = LI()
    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 d:
        print(d[i])

if __name__ == "__main__":
    main()

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

my_code()

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


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

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

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

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

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

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

p = [0]*N

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

for i in p:
    print(i)

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

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

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

Solution (Python):
n = int(input())
aList=[]
aList += [int(x) for x in input().split()]
bukaList=[0]*n
for i in range(n-1):
    bukaList[aList[i]-1]+=1
print(*bukaList,sep='\n')

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

Solution (Python):
import collections

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

C = collections.Counter(A_list)

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

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




'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

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

import collections
cnt=0
c=collections.Counter(a)
for i in range(1,n+1):
    if i not in c.keys():
        print(0)
    else:
        print(c[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):
 b[i]=str(b[i])
 print(b[i])

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

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

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

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

Solution (Python):
def input_int_list():
    return [int(thing) for thing in input().split(" ")]

def int_input():
    return int(input())


import collections
N = int_input()
A_list = input_int_list()
C = collections.Counter(A_list)
for i in range(1, N+1):
    if i in C:
        pass
    else:
        C[i] = 0

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

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

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve():
    n = II()
    a = LI()
    ans = [0] * n
    for i in range(n-1):
        ans[a[i] - 1] += 1
    print("\n".join(map(str, ans)))
    return



if __name__ == '__main__':
    solve()

Solution (Python):
n = int(input())
list_shain_index = list(map(int, input().split()))
list_num_buka = [0]*(n+1)
for num in list_shain_index:
  list_num_buka[int(num)] += 1

list_ans = map(str, list_num_buka[1:])
print(' '.join(list_ans))

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

cnt = defaultdict(lambda :0)
for i in a:
    cnt[i] += 1

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

for i in range(n-1):
	cnt[lis[i]-1]+=1

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

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

previous=1
count=0
for j in a+[n+1]:
    if j==previous:
        count+=1
    else:
        print(count)
        count=1
        for _ in range(j-previous-1):
            print(0)
        previous=j

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

from collections import Counter
c = Counter(a_li)

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

Solution (Python):

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

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

for k in n_subord:
    print(k)

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

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

Solution (Python):


s = [input() for i in range(2)]
n = int(s[0])
a = list(map(int, s[1].split()))




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

for line in x:
    print(line)

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

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

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


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

for a in A:
  if a in bosses.keys():
	  bosses[a] += 1
  else:
    bosses[a] = 1

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

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

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    A = kwargs["A"]
    B = [0 for i in range(n)]

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

    res = "\n".join([str(i) for i in B])
    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    
    
    kwargs["n"] = [int(i) for i in cin][0]
    
    cin = input().split()
    kwargs["A"] = [int(i) for i in cin]

    cout = main(kwargs)
    print(cout)

Solution (Python):
n = int(input())
l = map(int, input().split())
d = {k:0 for k in range(1, n+1)}
for i in l:
    d[i] += 1
for i, j in d.items():
    print(j)

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

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

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

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


dic={}

for val in al:
    dic[val]=dic.get(val,0)+1

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

Solution (Python):
from collections import Counter

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

c = Counter(A)

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

Solution (Python):
n,*a,=map(int,open(0).read().split())
b=[0]*n
for i in a:
    b[i-1]+=1
print(*b,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 j in l:
    print(j)

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

    for a in ans:
        print(a)


    return

if __name__ == "__main__":
    main()

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

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

for i in L:
    print(i)

Solution (Python):
from collections import Counter
n = int(input())

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

c = Counter(l)

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

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

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

Solution (Python):
import os
 
def main():
        n = int(input())
        a_list = list(map(int, input().split()))
        result = [0] * n
        for i in a_list:
            result[i-1] += 1
        for i in result:
                print(i)
 
if __name__ == "__main__":
        main()

Solution (Python):
from collections import Counter

N = int(input())

A = Counter([int(x) for x in input().split()])

for i in range(1,N+1):
  print(A.get(i) if A.get(i) is not None else 0)

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

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

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

Solution (Python):
if __name__ == "__main__":
    n = int(input())
    a = [int(x) for x in input().split()]
    result = [0 for x in range(len(a)+1)]

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

    for item in result:
        print(item)

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

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

for i in subs:
  print(i)

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

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

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

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

Solution (Python):

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

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

Solution (Python):


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

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

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

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

lis = [0] * n
for i in A:
  lis[i-1] += 1

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

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