peterverebics/CodeNet_Python_118 huggingface dataset:
# -*- coding: utf-8 -*-

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

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

ans = [0] * n

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

for a in ans:
    print(a)
import collections

N = int(input())

c = collections.Counter([int(x) for x in input().split()])
for i in range(N):
    print(c[i+1])
N = int(input())

List1 = [int(a) for a in input().split(" ")]
List2 = [0]*N

for x in List1:
  List2[x-1] = List2[x-1] + 1
  
for y in List2:
  print(y)
n = int(input())
dicti = dict({})
for i in range(1,n+1):
    dicti.update({i : 0})
arr = list(map(int,input().split()))
for x in arr:
    a = dicti[x]
    dicti.update({x : a+1})
for i in range(1,n+1):
    print(dicti[i])
n = int(input())
a = list(map(int, input().split()))
ans = [0 for _ in range(n)]
for i in a:
    ans[i-1] += 1

for m in ans:
    print(m)
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])
from collections import Counter
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    N,*A = map(int, read().split())

    t = Counter(A)

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


if __name__ == "__main__":
    main()
import collections
n = int(input())
a = list(map(int, input().split()))

count = collections.Counter(a)
for n in range(n):
    print(count[n+1])#1の個数から数える
N = int(input())
A = list(map(int, input().split()))
cnt = []
[cnt.append(0) for _ in range(len(A))]

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

for i in range(N-1):
    print(cnt[i])

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

if N==2:
    print(1)
    print(0)
else:
    from collections import deque
    da=deque(A)
    
    import numpy as np
    ansl=np.array([0]*N)
    
    for i in range(N-1):
        ansl[da.pop()-1]+=1
    
    for i in ansl:
        print(i)
N = int(input())
L = [int(s) for s in input().rstrip().split(' ')]
L_0 = [0 for i in range(N)]
for x in L:
    L_0[x-1] += 1
for y in L_0:
    print(y)
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
c = Counter(a)
for k in range(1, n + 1):
    print(c[k])
import collections

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

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

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

box = [0 for _ in range(n+1)]

for x in lst:
    box[x] += 1

for mybuka in box[1:n+1]:
    print(mybuka)
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)
n = int(input())
an = [0 for _ in range(n)]

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

for a in an:  
  print(a)
import sys
from collections import *
import heapq
import math
from math import gcd
import bisect
import copy
from itertools import permutations,accumulate,combinations,product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

import collections

c = collections.Counter(ii)
k = list(c.keys())

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

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

lis = [0] * N

for i in range(N-1):

    lis[A[i]-1] += 1

for i in range(N):
    print (lis[i])
import collections
N = int(input())
A = list(map(int , input().split()))
S = []
c = collections.Counter(A)
for i in range (N):
    S.append(c[i + 1])
for j in range(N):
    print(S[j])
c=[0]*int(input())
for q in map(int,input().split()):c[q-1]+=1
print(*c)
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')
import collections

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

for i in range(1,len(A)+2):
    print(a[i])
a= int(input())
b = list(map(int,input().split()))
b = list(map(lambda x : x-1,b))

bukas = [[]for i in range(a)]
for i in range(1,a):
    bukas[b[i-1]].append(i)
for c in bukas:
    print(len(c))
n = input()
n=int(n)
A = list(map(int, input().split()))
ANS = [0] * n
for i in A:
    ANS[i-1] += 1
for i in ANS:
    print(i)
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())
    
    C = [0] * N
    for a in A:
        C[a-1] += 1
    
    print(*C, sep='\n')
    return


if __name__ == '__main__':
    main()
n = int(input())
a = list(map(int, input().split()))
c = [0] * n

for x in a:
  c[x-1] += 1
for x in c:
  print(x)
import collections

N = int(input().split()[0])
a_list = list(map(int, input().split()))
c = collections.Counter(a_list)
ans = ""
for i in range(N):
    ans += str(c[i + 1]) + "\n"
print(ans)
import collections as c
n=int(input())
A=c.Counter(map(int,input().split()))
for i in range(1,n+1):
    print(A[i])
N = int(input())
A = list(map(int, input().split()))
dic = {}
for a in A:
    if a in dic.keys():
        dic[a]+=1
    else:
        dic[a] = 1
for i in range(1,N+1):
    print(dic[i] if i in dic.keys() else 0)
import collections

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

c = collections.Counter(target)
for i in range(n):
  print(c[i+1])
def main():
  n = int(input())
  a = list(map(int,input().split()))
  l = [0] * n
  for i in a:
    l[i-1] += 1
  for i in range(n):
    print(l[i])

main()
N = int(input())
lCnt = {}
for n in range(N):
  i = n + 1
  lCnt[i] = 0
i = 2
for n in input().split():
  Ai = int(n)
  lCnt[Ai] += 1
  i += 1
for n in lCnt:
  print(lCnt[n])
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))

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

for j in range(N-1):
  a[s[j]-1]+=1
for h in range(N):
  print (a[h])
import numpy as np

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

ans=np.zeros(N)
for A in An:
    ans[A-1] += 1

for a in ans:
    print(int(a))
n = int(input())
tmp = input()
a = [int(s) for s in tmp.split()]
count = [0] * n

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

for i in count:
    print(i)
# C - management
from collections import Counter


def main():
    N, *A = map(int, open(0).read().split())
    cnt_subordinates = Counter(A)
    ans = [cnt_subordinates[i] for i in range(1, N + 1)]
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()
n = int(input())
a = [int(i) for i in input().split()]
temp = [0 for i in range(n)]
for i in a:
    temp[i - 1] += 1
for i in temp:
    print(i)
N = int(input())
A = list(map(int, input().split()))
bosses = [0]*N
for a in A:
    bosses[a-1] += 1
for boss in bosses:
    print(boss)
N = int(input())
As = list(map(int, input().split()))
ct = [0] * N

for a in As:
    ct[a-1] += 1

for c in ct:
    print(c)
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])
N = int(input())
a = [int(x) for x in input().split()]
list = []
for i in range(N):
    list.append(0)
j = 0
for j in range(N-1):
    list[a[j]-1] +=1

for k in range(N):
    print(list[k])
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    from collections import Counter
    c = Counter(A)
    for i in range(1, N+1):
        print(c[i])


if __name__ == '__main__':
    main()
n = int(input())
A = list(map(int, input().split()))
M = [0] * (n+1)
for a in A:
  M[a] += 1
for i in range(1, n+1):
  print(M[i])
n = int(input())
al = list(map(int, input().split()))

ans_al = [0]*n

# for i in range(n):
#     ans_al[i-1] += al.count(i)

for a in al:
    ans_al[a-1] += 1

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

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

from collections import Counter
from collections import deque

c = Counter(A)
d = deque(sorted(c.most_common()))
# print(d)

# print(d.popleft())

frg = True
for i in range(1, n+1):
    if d and frg:
        _q = d.popleft()
        frg = False
    elif not d and frg:
        _q = (-1, -1)

    if _q[0] == i:
        print(_q[1])
        frg = True

    else:
        print(0)
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])
len = int(input())
result = [0 for _ in range(len)]
nums = map(lambda x: int(x), input().split(' '))
for num in nums:
  result[num - 1] = result[num - 1] + 1
print(' '.join([str(n) for n in result]))
from collections import Counter
def readInt():
    return list(map(int,input().split()))
n = int(input())
a = readInt()
ans = Counter(a)
# print(ans)
for i in range(1,n+1):
    print(ans[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 i in range(n):
    print(b[i])
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)))
i=int(input())
a=list(map(int,input().split()))
l=[0]*i
for j in a:
  l[j-1]=l[j-1]+1
print(*l)
N = int(input())
A = list(map(int, input().split()))
D = {c:0 for c in range(N)}
for a in A:
  D[a-1] += 1
for d in D.values():
  print(d)
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()
cnt = Counter(a)

for i in range(1,n+1):
    print(cnt[i])
n = int(input())
a = list(map(int, input().split()))
a.sort()

tmp = 0
cnt = 0
for i in range(1, n+1):
    while tmp < n-1 and a[tmp] == i:
        cnt += 1
        tmp += 1
    print(cnt)
    cnt = 0
import sys
input = sys.stdin.readline

def main():
  result = [0] * int(input())
  arg = [int(i) for i in input().split()]
  
  for i in arg:
    result[i-1] = result[i-1] + 1
  
  for i in result:
    print(i)
  
if __name__ == '__main__':
  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 x in ans:
  print(x)
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    from collections import Counter
    c = Counter(A)
    for i in range(N):
        print(c[i+1])


if __name__ == '__main__':
    main()
N = int(input())
A = list(map(int, input().split()))
result = [0 for _ in range(N)]
for i in range(N-1):
    result[A[i]-1] += 1

for r in result:
    print(r)
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)
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])
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
import math
import bisect
import numpy as np
from collections import defaultdict, deque, Counter
from operator import itemgetter
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
# INF = float("inf")


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()
n = int(input())
*A, = map(int, input().split())
F = {}
for i, a in enumerate(A):
    try:
        F[a] += 1
    except:
        F[a] = 1
for i in range(1, n+1):
    try:
        print(F[i])
    except:
        print(0)
n = int(input())
A = list(map(int, input().split()))
cnts = [0]*n
for a in A:
    cnts[a-1] += 1
for cnt in cnts:
    print(cnt)
from collections import defaultdict

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

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

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

a = collections.Counter(A)

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

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

for supervisor in A:
    count[supervisor-1] += 1

for i in range(len(count)):
    print(count[i])
N = int(input())
A = list(map(int, input().split()))

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

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

for i in range(2, n + 1):
    fuck[a[i - 2]].append(i)


for i in range(1, n + 1):
    print(len(fuck[i]))
n=int(input())
a=list(map(int,input().split()))
x=[0]*n
for i in range(n-1):
  x[a[i]-1]+=1
for j in range(n):
  print(x[j])
def main():
    N = input_int()
    A = input_int_list_in_line()
    A = [-1, -1] + A

    num_buka = [0] * (N+1)

    for i in range(2, len(A)):
        num_buka[A[i]] += 1

    for i in range(1, len(A)):
        print(num_buka[i])


def input_int():
    return int(input())


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


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


def input_int_tuple_list(n: int, q: int):
    return [tuple(map(int, input().split())) for _ in range(n)]


main()
N=int(input())
alist=list(map(int,input().split()))

answer_dic={}
for a in alist:
  if a in answer_dic:
    answer_dic[a]+=1
  else:
    answer_dic[a]=1
#print(answer_dic)

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

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

[print(i) for i in ans]
n=int(input())
a=list(map(int,input().split()))
memo=[0]*n
for i in a:
    memo[i-1]+=1
for i in memo:
    print(i)
# abc163_c.py
N = int(input())
ans = [0]*N
M = list(map(int,input().split()))
for i in M:
    ans[i-1] += 1
for i in ans:
    print(i)
# C management

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

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

for s in S:
  print(s)
N = int(input())
A = list(input().split())
boss = [0]

for i in range(N-1):
  boss.append(0)
  boss[int(A[i])-1] += 1

for i in range(N):
  print(str(boss[i]))
from collections import Counter
from collections import defaultdict
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    d = Counter(a)
    for i in range(1, n+1):
        print(d[i])
main()
import math

n = int(input())
aL = list(map(int, input().split(" ")))

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

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

for c in cnt:
    print(c)
n = int(input())
A = [int(x) for x in input().split()]
ans = [0] * n

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

for i in range(n):
    print(ans[i])
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)
import collections
N = int(input())
boss = list(map(int, input().split()))
c = collections.Counter()
for b in boss:
    c[b] += 1
for i in range(1,N+1):
    print(c[i])
n = int(input())
dic = {i:0 for i in range(1, n+1)}
for value in map(int, input().split()):
    dic[value] += 1
for i, j in sorted(dic.items(), key=lambda x: x[0]):
    print(j)
import collections

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

c = collections.Counter(a)

for i in range(1, n + 1):
	if i in c:
		print(c[i])
	else:
		print(0)
n = int(input())
a = [int(x) for x in input().split()]
c = [0]*n
for i in a:
  c[i-1]+=1
for i in c:
  print(i)
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    Subs = [0 for _ in range(N)]
    for i, a in enumerate(A):
        Subs[a-1] += 1
    [print(n) for n in Subs]

if '__main__' == __name__:
    resolve()
from collections import Counter

n = int(input())
c = Counter((int(i) for i in input().split(' ')))
for i in range(1, n + 1):
    if i in c:
        print(c[i])
    else:
        print(0)
import numpy as np
 
 
if __name__ == '__main__':
    List = [list(map(int, input().split())) for i in range(2)]
    N = List[0][0]
    buka = np.array(List[1][:])
 
 
    l_out = np.zeros(N,dtype=int)
 
    for i in range(N-1):
        l_out[buka[i]-1] += 1
 
    for i in range(N):
        print(l_out[i])
N = int(input())
A = list(map(int,input().split()))
B = [0]*N
for i in range (len(A)):
    B[A[i]-1] +=1
print('\n'.join(map(str, B)))
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)))
N = int(input())
A = list(map(int, input().split()))

import numpy as np
arr = np.array(A)-1
binc = np.bincount(arr)
binc.resize(N)
for s in binc:
    print(s)
num = int(input())
a=[0*num for i in range(num)]
boss=input().split(" ")
for i in range(num-1):
  a[int(boss[i])-1]+=1
for i in range(num):
  print(a[i])
from collections import defaultdict, Counter

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

D = Counter(arg)

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

l = {}
for a in A:
    if a in l:
        l[a] += 1
    else:
        l[a] = 1

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

N = [0]*(n+1)
for a in A:
  N[a] += 1

for i in range(1, n+1):
  print(N[i])
N = int(input())
An = list(map(int,input().split()))
ret = [0] * N
for k in range(len(An)):
  ret[An[k] - 1] += 1
for k in range(N):
  print(ret[k])
n = int(input())
A = [int(i) for i in input().split()]
empNum = {int(i):0 for i in range(1,n+1)}

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

for v in empNum.values(): print(v)
N = int(input())
A = list(map(int, input().split()))

sub_num = dict()
for a in A:
    if a - 1 in sub_num:
        sub_num[a - 1] += 1
    else:
        sub_num[a - 1] = 1
        
for i in range(N):
    if i in sub_num:
        print(sub_num[i])
    else:
        print(0)
N = int(input())
A = tuple(map(int, input().split()))
lst = [0] * N
for a in A:
    lst[a - 1] += 1
for x in lst:
    print(x)
t = int(input())
A = list(map(int,input().split()))
B = [0]*t
for i in range(t-1):
    B[A[i]-1] += 1
for i in range(t):
    if B[i]!= -1:
      print(B[i]) 
    else:
      print(0)
N = int(input())
As = list(map(int, input().split()))
b = [0]*N
for a in As:
    b[a-1] += 1
for i in b:
    print(i)
N = int(input())
A = list(map(int, input().split()))

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

c = collections.Counter(A)
ans = [0]*N

for ci in c.items():
    ans[ci[0]-1]=ci[1]

for i in ans:
    print(i)
N = int(input())
bosses = [0]*N
ids = list(map(int, input().split()))
for x in ids:
	bosses[x-1] += 1
for y in bosses:
	print(y)
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)
N = int(input())
an = [int(i) for i in input().split()]

result = { i + 1: 0 for i in range(N) }

for ai in an:
    result[ai] += 1

for r in result.values():
    print(r)
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)
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))
import collections
n=int(input())
a=list(map(int, input().split()))
a=collections.Counter(a)
for i in range(1,n+1):
    print(a.get(i, 0))
N=int(input())
A=list(map(int, input().split()))
b=[0]*N
for i in A:
    b[i-1]+=1
for j in b:
    print(j)
n = int(input())
m=list(map(int,input().split()))
A=[0]*n
for i in range(n-1):
    A[m[i]-1]+=1
print(*A, sep = "\n")
import numpy as np
import math
import itertools

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

if __name__ == '__main__':
    main()
n = int(input())
a = list(map(int, input().split())) # list()でリスト化、それを変数に代入。
#一行で入力された数値をリストに
list=[0]*(n)

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

for i in range(n):
    print(list[i])
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right,insort_left,insort_right
from heapq import heapify,heappop,heappush
from copy import deepcopy
from itertools import accumulate,groupby,permutations,combinations
from math import ceil,sqrt,cos,sin,pi,gcd

N = int(input())
A = [int(i) - 1 for i in input().split()]

cnt = [0] * N

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

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