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-----
5
1 1 2 2

-----Sample Output-----
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.

Difficulty: EASY

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


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


N = int(input())
A = list(map(int, input().split()))
E = [0] * N
for e in A:
	E[e - 1] += 1
print(*E, sep='\n')


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


a = int(input())
f = list(map(int, input().split()))
f.sort()
count = 1
ans = [0 for i in range(a)]
for i in range(len(f) - 1):
	if f[i] == f[i + 1]:
		count += 1
	else:
		ans[f[i] - 1] = count
		count = 1
if count >= 1:
	ans[f[-1] - 1] = count
for i in ans:
	print(i)


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


import collections
n = int(input())
li = list(map(int, input().split()))
res = [0] * (n + 1)
for i in li:
	res[i] += 1
for i in range(1, len(res)):
	print(res[i])


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


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


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


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


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


N = int(input())
G = [0] * N
for i in [int(x) for x in input().split()]:
	G[~-i] += 1
print(*G, sep='\n')


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


N = int(input())
A = input()
A = A.split()
B = [0] * N
for i in A:
	B[int(i) - 1] = B[int(i) - 1] + 1
for i in B:
	print(i)


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


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


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


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


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


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


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


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


n = int(input())
a = [int(x) for x in input().split()]
c = [0] * n
for e in a:
	c[e - 1] += 1
for e in c:
	print(e)


import collections

def main() -> None:
	n = int(input())
	boss_dict = collections.Counter(tuple(map(int, input().split())))
	for i in range(n):
		print(boss_dict[i + 1] if boss_dict[i + 1] else 0)
	return

def __starting_point():
	main()
__starting_point()


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


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


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


a = int(input())
b = [0] * a
for c in map(int, input().split()):
	b[c - 1] += 1
print('\n'.join(map(str, b)))


n = int(input())
l = [0] * n
for s in input().split():
	l[int(s) - 1] += 1
for x in l:
	print(x)


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


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


c = [0] * int(input())
for q in map(int, input().split()):
	c[q - 1] += 1
print(*c)


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


n = int(input())
employees = input().split(' ')
employees_changed = []
for i in range(0, len(employees)):
	employees_changed.append(int(employees[i]))
ans = [0] * (n + 1)
for x in employees_changed:
	ans[x] += 1
for i in range(1, n + 1, 1):
	print(ans[i])


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


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


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


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


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


r = [0] * int(input())
for x in map(int, input().split()):
	r[x - 1] += 1
print(*r, sep='\n')


import collections
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 range(N):
	print(l[j])


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


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


a = [0] * int(input())
for i in input().split():
	a[int(i) - 1] += 1
for i in range(len(a)):
	print(f'{a[i]}')


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


import math
n = int(input())
c = [0] * n
s = map(int, input().split())
for i in s:
	c[i - 1] += 1
for i in c:
	print(i)


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


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)


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


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


import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque, Counter
from decimal import Decimal
import functools

def v():
	return input()

def k():
	return int(input())

def S():
	return input().split()

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

def X():
	return list(input())

def L():
	return list(input().split())

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

def lcm(a, b):
	return a * b // math.gcd(a, b)
sys.setrecursionlimit(10 ** 6)
mod = 10 ** 9 + 7
cnt = 0
ans = 0
inf = float('inf')
al = 'abcdefghijklmnopqrstuvwxyz'
AL = al.upper()
n = k()
l = l()
a = []
for i in range(n):
	a.append(0)
for i in range(n - 1):
	a[l[i] - 1] += 1
for i in range(n):
	print(a[i])


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


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


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


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


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


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


from collections import *
(n, *a) = map(int, open(0).read().split())
c = Counter(a)
for i in range(n):
	print(c[i + 1])


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


(n, a) = open(0)
b = [0] * int(n)
for i in a.split():
	b[int(i) - 1] += 1
print(*b)


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


from typing import List

def answer(n: int, a: List[int]) -> List[int]:
	result = [0] * n
	for i in a:
		result[i - 1] += 1
	return result

def main():
	n = int(input())
	a = list(map(int, input().split()))
	for i in answer(n, a):
		print(i)

def __starting_point():
	main()
__starting_point()


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


(n, *a) = map(int, open(0).read().split())
l = [0] * n
for i in a:
	l[i - 1] += 1
print(*l, sep='\n')


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


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


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


import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
input = sys.stdin.readline

def RD():
	return input().rstrip()

def F():
	return float(input().rstrip())

def I():
	return int(input().rstrip())

def MI():
	return map(int, input().split())

def MF():
	return map(float, input().split())

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

def TI():
	return tuple(map(int, input().split()))

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

def Init(H, W, num):
	return [[num for i in range(W)] for j in range(H)]

def main():
	N = I()
	L = LI()
	D = [0] * N
	for (index, num) in enumerate(L[::-1]):
		D[num - 1] += 1
	for i in D:
		print(i)

def __starting_point():
	main()
__starting_point()


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


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


n = int(input())
l = [0] * n
for (i, v) in enumerate(list(map(int, input().split()))):
	l[v - 1] += 1
print(*l, sep='\n')


(n, *A) = list(map(int, open(0).read().split()))
B = [0] * n
for a in A:
	B[a - 1] += 1
print(*B, sep='\n')


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


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


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


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


from collections import Counter
N = int(input())
A = list([int(x) for x in input().split()])
result = dict(Counter(A))
for i in range(1, N + 1):
	if i in result:
		print(result[i])
	else:
		print(0)


N = int(input())
src = list(map(int, input().split()))
T = [0] * N
for s in src:
	T[s - 1] += 1
for t in T:
	print(t)


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


n = int(input())
a = [0] + list(map(int, input().split()))
l = [0] * n
for i in a:
	l[i - 1] += i
for j in range(n):
	l[j] = int(l[j] / (j + 1))
for k in l:
	print(k, end='\n')


def i_input():
	return int(input())

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

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

def i_row(N):
	return [int(input()) for _ in range(N)]

def i_row_list(N):
	return [list(map(int, input().split())) for _ in range(N)]
n = i_input()
aa = i_list()
shain = [0] * n
for a in aa:
	shain[a - 1] += 1
for s in shain:
	print(s)


n = int(input())
A = tuple(map(int, input().split()))
Ans = [0] * n
for a in A:
	Ans[a - 1] += 1
print(*Ans, sep='\n')


c = [0] * int(input())
for x in input().split():
	c[int(x) - 1] += 1
print('\n'.join((str(x) for x in c)))


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


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


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)


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


def __starting_point():
	N = int(input())
	li = list(map(int, input().split()))
	ans = [0] * (N + 1)
	for i in range(len(li)):
		ans[li[i]] += 1
	for i in range(1, N + 1):
		print(ans[i])
__starting_point()


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


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)


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


n = int(input())
al = list(map(int, input().split()))
b = [0] * n
for a in al:
	b[a - 1] += 1
print(*b, sep='\n')


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


from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
n = int(input())
A = list(map(int, input().split()))
b = [0] * (n + 1)
for i in A:
	b[i] += 1
for i in range(1, n + 1):
	print(b[i])


N = int(input())
(*A,) = sorted(map(int, input().split()))
s = [0] * N
for i in A:
	s[i - 1] += 1
for t in s:
	print(t)


n = int(input())
B = [0] * n
for x in input().split():
	B[int(x) - 1] += 1
for x in B:
	print(x)


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


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


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


def calc(n, m):
	import collections
	edict = dict()
	for i in range(1, len(m) + 2):
		edict[i] = []
	for j in range(len(m)):
		edict[m[j]].append(j)
	for k in edict:
		print(len(edict[k]))

def main():
	n = int(input())
	employees = list((int(v) for v in input().split()))
	return calc(n, employees)

def __starting_point():
	main()
__starting_point()


n = int(input())
A = list(map(int, input().split()))
for i in range(n - 1):
	A[i] = A[i] - 1
res = [[] for i in range(n)]
for i in range(n - 1):
	res[A[i]].append(i)
for i in range(n):
	print(len(res[i]))


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


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


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


num = int(input())
table = list(map(int, input().split()))
table2 = []
for i in range(num):
	table2.append(0)
for j in range(len(table)):
	table2[table[j] - 1] += 1
for k in table2:
	print(k)


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


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


N = int(input())
dct = {}
A = list(map(int, input().split()))
for a in A:
	if a in dct.keys():
		dct[a] += 1
	else:
		dct[a] = 1
for n in range(1, N + 1):
	print(dct.get(n, 0))


n = int(input())
buka = [0] * n
for joushi in input().split():
	buka[int(joushi) - 1] += 1
print(*buka, sep='\n')


def __starting_point():
	n = int(input())
	A = list(map(int, input().split()))
	B = [0] * n
	for a in A:
		B[a - 1] += 1
	for b in B:
		print(b)
__starting_point()


(n, *a) = map(int, open(0).read().split())
l = [0 for i in range(n)]
for i in a:
	l[i - 1] += 1
print('\n'.join(map(str, l)))


(n, *a) = map(int, open(0).read().split())
l = [0] * n
for x in a:
	l[x - 1] += 1
print('\n'.join(map(str, l)))


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


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


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


import sys
readline = sys.stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
ans = [0] * N
for i in range(len(A)):
	ans[A[i] - 1] += 1
for a in ans:
	print(a)


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


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


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


N = int(input())
As = map(int, input().split())
bs = [0] * N
for a in As:
	bs[a - 1] += 1
for b in bs:
	print(b)