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 math
import sys
from collections import defaultdict
input = sys.stdin.readline


def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))
    
n = inp()
A = invr()

map = defaultdict(int)
for i, boss in enumerate(A, 2):
	map[boss] += 1 
	
for i in range(n):
	print map[i+1]

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

b = [0]*n

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

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

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

dic = [0]*n

for i in slist:
    dic[i-1] += 1
    
for i in dic:
    print(i)

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

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

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

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

l = [0]*n
i = 0
while i<n-1:
    l[a[i]-1]+=1
    i+=1

i=0
while i<n:
    print(l[i])
    i+=1

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

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

t = [print(i) for i in buka]

Solution (Python):
from collections import Counter

N = int(input())

a = list(int(i) for i in input().split()) 

b = Counter(a)
for i in range(1,N+1):
    print(b[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 = [0]
a.extend(list(map(int, input().split())))
cnt = {}
for i in range(n):
  cnt.setdefault(i, 0)
  if a[i] != 0 :
    cnt[a[i]-1] += 1

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

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

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
Li = [[] for i in range(N)]
for i,joushi in enumerate(A):
  Li[joushi-1].append(i+2)
for i in range(N):
  print(len(Li[i]))

Solution (Python):
def main():
    n = int(input())
    a = [int(v) - 1 for v in input().split()]
    b = [0 for _ in range(n)]
    for i in a:
        b[i] += 1
    for v in b:
        print(v)


if __name__ == '__main__':
    main()

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):
import collections
N = int(input())
strA = input().split()
ans = collections.Counter(strA)
for i in range(1, N+1):
    print(ans[str(i)])

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

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

for x in range(2,N+1):
    S[A[x-2]]+=1

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

Solution (Python):
from collections import defaultdict, deque

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

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

Solution (Python):
N = int(input())
values = list(map(int, input().split()))
values_dict = {}

for value in values:
    values_dict[value] = values_dict.get(value, 0) + 1
for i in range(1, N+1):
    print(values_dict.get(i, 0))

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

Solution (Python):
import collections
def resolve():
    N = int(input())
    strA = input().split()
    ans = collections.Counter(strA)
    for i in range(1,N+1):
        print(ans[str(i)])
resolve()

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

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

a = list(map(int, input().split()))
anslst = [0]*(N-1)

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

for ans in anslst:
  print(ans)

print(0)

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

Solution (Python):
import numpy as np

n = int(input())
base = np.zeros(n)
a = np.array(list(map(int,input().split())))

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

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

Solution (Python):
if __name__ == "__main__":
    tcase = int(input())
    pcase = [ int(i) for  i in input().split(' ')]
    leng = len(pcase) + 1
    items = [0]*leng
    for i in pcase:
        items[i-1] +=1
    for i in items:
        print(i)

Solution (Python):






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

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

for j in ans:
    print(j)

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

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

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

Solution (Python):
N=int(input())
josi = list(map(int,input().split()))
count=[0]*N
n=0
while n<N-1:
  count[josi[n]-1] =count[josi[n]-1]+1
  n=n+1
n=0
while n<N:
  print(count[n])
  n=n+1

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

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

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

for v in l:
    print(v)

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

ans = [0]*n
counter = 0
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()))

a.sort()
a = collections.deque(a)
counter = 0
for i in range(1, n+1):
    while len(a) != 0:
        if i != a[0]: 
            break
        counter += 1
        a.popleft()    
    print(counter)
    counter = 0

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

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

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

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

Solution (Python):



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

Solution (Python):
from collections import Counter

N = int(input())
counter = Counter(tuple(map(int, input().split(' '))))

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

Solution (Python):
n = int(input())
ar = [int(x) for x in input().split()]
count = [0]*n

for v in ar:
    count[v-1]+=1

for v in count:
    print(v)

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

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

a = [int(x) for x in 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):
import sys
N = int(input())
A = list(map(int, sys.stdin.readline().rstrip().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):
import collections
n = int(input())
a = [int(x) for x in input().split()]
c = collections.Counter(a)

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

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

for i in m:
    syain[i-1] += 1

print('\n'.join(list(map(str,syain))))

Solution (Python):
N = int(input())
A = [int(n) for n in input().split(' ')]
boss = {}
for i in range(N-1):
  try:
    boss[A[i]] += 1
  except:
    boss[A[i]] = 1
    
for i in range(1, N+1):
  try:
    print(boss[i])
  except:
    print(0)

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

D={}
for i in range(N-1):
    if (A[i] in D.keys())==True:
        D[A[i]]+=1
    elif (A[i] in D.keys())==False:
        D[A[i]]=1
for i in range(1,N+1):
    try:
        print(D[i])
    except:
        print(0)

Solution (Python):


import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = LI()
ans = [0] * N

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

Solution (Python):
n=int(input())
ls=list(map(int,input().split()))
counter=[0 for _ in range(n-1)]
for i in ls:
  counter[i-1]+=1
for i in counter:
  print("{}".format(i))
print("0")

Solution (Python):
N = int(input())
*A, = map(int, input().split())
dic = {i: 0 for i in range(1, N+1)}
for x in A:
    if x in dic:
        dic[x] += 1
for k, v in dic.items():
    print(v)

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


sig = [0] * N

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



for i in sig:
  print(i)

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

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

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())
p=list(map(int,input().split()))
m=[0]*n
for i in p:
    m[i-1]+=1
for a in m:
    print(a,"\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):
import sys
from collections import deque
import copy
def main():
    N = int(input())
    A = [(int(i) - 1) for i in input().split()]
    ans = [0 for i in range(N)]
    for i in range(len(A)):
        ans[A[i]] += 1
    for i in range(N):
        print(ans[i])


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
t = list(input().split(" "))
s={}
for i in set(t):
    s[i] = 0
    
for i in t:
    s[i] += 1



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

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

ans = [0 for _ in range(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 j in ans:
    print(j)

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

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

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
line=input()
koko=line.split()
koko=map(int,koko)
koko=list(koko)
ans=dict.fromkeys(list(range(n+1)),0)
for val in koko:
     ans[val]=ans.get(val,0)+1
po=ans.pop(0)
for (k,v) in ans.items():
     print(v)

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):
def main():
        N = int(input())
        A = list(map(int, input().split()))

        l = [0]*N

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

        ans = "\n".join([str(x) for x in l])
        print(ans)

if __name__=="__main__":
        main()

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

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

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

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

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

count = Counter(a)
for i in range(n):
  if i+1 in count:
    print(count[i+1])
  else:
    print(0)

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

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

l = [0] * N

for i in range(len(s)):
  l[s[i] - 1] = l[s[i] - 1] + 1
  
for i in range(N):
  print(l[i])

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

Solution (Python):
import sys
from collections import defaultdict, deque, Counter










stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    n = int(stdin.readline().rstrip())
    
    a = list(map(int, stdin.readline().rstrip().split()))
    
    
    
    
    c = Counter(a)
    for i in range(n):
        print(c[i+1])

main()

Solution (Python):
N = int(input().strip())
data = [0 for _ in range(N)]
for i in input().strip().split(' '):
    data[int(i)-1] += 1

for d in data:
    print(d)

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

ans = [0] * (N + 1)

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

Solution (Python):
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))

    g = [0] * n
    for ai in a:
        g[ai - 1] += 1
    print(*g, sep='\n')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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


employ = {}

for i in range(len(a)):
    if a[i] in employ:
        employ[a[i]] = employ[a[i]] + 1
    else:
        employ[a[i]] = 1


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

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

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

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

for i in check:
    print(i)

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

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

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

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

for n in ans:
    print(n)

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

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

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

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 = [int(x) for x in input().split()]
L = [0]*N
for i in range(N-1):
  L[A[i]-1]+=1
[print(i) for i in L]

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

dic = {}
for i in range(1,n+1):
    dic[i] = 0

for a in an:
    dic[a] += 1

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

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

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

for i in tm:
    print(i)

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

l = [0] * n

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

for v in l:
    print(v)

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

count = [0]*N

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

for i in count:
    print(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()))
res = [0] * N

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

for i in res:
    print(i)

Solution (Python):
def main():
    n = int(input())
    As = list(map(int, input().split()))

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


if __name__ == "__main__":
    main()

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

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

for x in L:
    l[x-1] += 1

for i in l:
    print(i,end="\n")

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

Solution (Python):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
ans = np.zeros(N)
for i in A:
    ans[i-1] +=1
for i in ans:
    print(int(i))

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

ans = [0] * (N+1)

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

for a in ans[1:]:
    print(a)

Solution (Python):
def solve(string):
    n, *a = map(int, string.split())
    ans = [0] * n
    for _a in a:
        ans[_a - 1] += 1
    return "\n".join(map(str, ans))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

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

from collections import defaultdict
d = defaultdict(int)

for ai in A:
  d[ai] += 1

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

Solution (Python):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
ans = np.zeros(N)
for i in A:
    ans[i-1] += 1
for i in ans:
    print(int(i))

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

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())
A = list(map(int,input().split()))
T = {}
for i in A:
    if i not in T:
        T[i] = 0
    T[i] = T[i] + 1
for i in range(1, N+1):
    print(T.get(i, 0))

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

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

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

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

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

subordinates = [0] * (N + 1)
for boss in bosses:
  subordinates[boss] += 1

print("\n".join(map(str, subordinates[1:])))

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

subordinates = [0] * (N + 1)
for boss in bosses:
  subordinates[boss] += 1
  
for count in subordinates[1:]:
  print(count)

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

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

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


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


if __name__ == '__main__':
    main()

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

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

for k in ans:
    print(k)

Solution (Python):
import collections as col

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

List = col.Counter(List)
Count_List = [0]*n
for i in List:
    Count_List[i-1] = List[i]

for i in Count_List:
    print(i)

Solution (Python):
import collections as col

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

List = col.Counter(List)
Count_List = [0]*n
for i in List:
    Count_List[i-1] = List[i]

for i in range(0,len(Count_List)):
    print(Count_List[i])

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

Solution (Python):
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n=int(input())
count=[0]*n
a=list(map(int,stdin.readline().split()))
for i in a:
    count[i-1]+=1
for i in count:
    print(i)

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

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

ans = [0 for i in range(N)]
for i in range(len(A)):
  ans[A[i]-1] += 1
  
print(*ans,sep = "\n")

Solution (Python):
N = int(input())
A = [int(_) for _ in input().split()]
cnt = [0 for i 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()))
h={1: 0}
for i in range(N-1):
  if not i+2 in h:
    h[i+2] = 0
  h[A[i]] += 1
for i in list(h.values()):
  print(i)

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

if __name__ == '__main__':
    main()

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

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

main()

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

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

a = map(int,input().split())
ans = [0]*n

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

for ai in ans:
  print(ai)

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

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

men = {}

for i in range(1, n+1):
    men[i] = 0

for i in a:
    men[i] += 1

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

Solution (Python):
from sys import stdin, stdout
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n = int(rl())
	cnt = defaultdict(lambda: 0)
	for boss in rli():
		cnt[boss] += 1
	for i in range(1, n + 1):
		print(cnt[i])
	stdout.close()

if __name__ == "__main__":
	main()

Solution (Python):
from sys import stdin, stdout
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n = int(rl())
	A = list(rli())
	cnt = defaultdict(lambda: 0)
	for i, boss in enumerate(A):
		cnt[boss] += 1
	for i in range(1, n + 1):
		print(cnt[i])
	stdout.close()

if __name__ == "__main__":
	main()

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

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

Solution (Python):
from sys import stdin
N = int(input())
A = [0]*2 + [int(n) for n in stdin.readline().split()]
ans = [0]+[0]*N
for i in range(2, N+1):
    ans[A[i]] += 1
for i in range(1, N+1):
    print(ans[i])

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

Solution (Python):



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 = [int(_) for _ in input().split()]

c = Counter(A)
for i in range(1, N+1):
    if c[i]:
        print(c[i])
    else:
        print(0)

Solution (Python):
def actual(n, a_list):
    points = [0 for _ in range(n)]

    for supervisor_idx in a_list:
        points[supervisor_idx - 1] += 1

    for p in points:
        print(p)

    return points

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

actual(n, a_list)

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

import collections
c=collections.Counter(A)

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

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

Solution (Python):
import collections

n = int(input())
dic = collections.Counter(input().split())
for i in range(n):
  print(dic[str(i+1)])

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

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

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

ans = '\n'.join(map(str,nums[1:]))
print(ans)

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

buka = [0] * N

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

for bi in buka:
    print(bi)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
nums = {}
for i in range(n):
    nums[i] = 0
for j in range(n-1):
    nums[a[j]-1] += 1
for key, value in nums.items():
    print(value)

Solution (Python):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
buka = np.zeros(N, dtype=int)  
for i in range(len(A)):
    buka[A[i]-1] += 1
for i in range(N):
    print(buka[i])

Solution (Python):
import itertools
import math
import fractions
import functools
n = int(input())
a = list(map(int, input().split()))

count = [0] * n

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

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

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

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

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

Solution (Python):
N = int(input())
A =  [0] * N
B = map(int, input().split())
for i in B:
  A[i - 1] += 1
for i in A:
  print("{}".format(i))

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
from collections import defaultdict

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