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 sys
from collections import Counter


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

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

count = Counter(A)

for i in range(N):
  if count.get(i):
    print(count.get(i))
  else:
    print(0)

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

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

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

for i in buka:
    print(i)

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

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 lis:
    print(i)

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


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

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

di = defaultdict(int)

for a in arr:
    di[a] += 1

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

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

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

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

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

Solution (Python):
n = int(input())
As = input().split()

ans = [0] * (n+1)
for a in As:
    ans[int(a)] += 1

ansstr = ""
for i in range(1, n+1):
    print(ans[i])

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

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

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

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

for a in a_list:
    l[a-1] += 1
for ans in l:
    print(ans)
print(0)

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] += 1

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

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

lst = [0]*n

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

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

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

Solution (Python):
from sys import stdin



N = [int(x) for x in stdin.readline().rstrip().split()]



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


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

Solution (Python):


import sys

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


def main():
    n = read(int)
    as_ = read_list(int)

    buka = [0] * (n + 1)
    for i, a in enumerate(as_):
        buka[a] += 1

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

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

from collections import Counter
cnt = Counter(A)

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

Solution (Python):
from collections import Counter

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

for i in range(1, N+1):
  print(counter.get(i, 0))

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

result = [0] * N
for v in A:
    result[v - 1] += 1

for v in result:
    print(v)

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

Solution (Python):




def main():
  N = int(input())
  counts = [0] * N

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

  for c in counts:
    print(c)


if __name__ == '__main__':
  main()

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

Solution (Python):

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

result = [0]*n

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

for ri in result:
    print(ri)

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):
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
A = rl()

B = [0] * (len(A)+1)
for i, a in enumerate(A):
    j = a - 1
    B[j] += 1
for b in B:
    print(b)

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    N = intinput()
    datas = list(mulinputs())
    bucket = [0] * N
    for data in datas:
        bucket[data-1] += 1

    
    for b in bucket:
        print(b)

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

for m in man:
    emp[m-1] += 1

for e in emp:
    print(e)

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

Solution (Python):
import collections as c
n=int(input())
A=c.Counter(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+1)
for i in a:
    ans[i] += 1
for i in range(1, n+1):
    print(ans[i])

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

Solution (Python):
def resolve():
    N = int(input())
    A = tuple(map(int, input().split()))
    AL = [0]*N

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

    for al in AL:
        print(al)

if __name__ == '__main__':
    resolve()

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

N = int(N)
A = [int(a) for a in A]

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

for a in ans:
    print(a)

Solution (Python):


import sys
import pprint

sys.setrecursionlimit(10 ** 6)

class Logger:
	def __init__(self, debug):
		self.debug = debug
	def print(self, *args):
		if self.debug:
			pprint.pprint(args)


def main():
	log = Logger(1)
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	cnt = {}
	for i in range(len(a)):
		cnt[a[i]-1] = cnt.get(a[i]-1, 0) + 1
	for i in range(n):
		print(cnt.get(i, 0))


	


main()

Solution (Python):



debug=1
def pront(*n):
    if debug==1:
        print(n)
        


base=10**9+7

def add(a,b):
    return (a+b)%base

def sub(a,b):
    return (a-b)%base

def multi(a,b):
    return (a*b)%base

def exp(a,b):
    x=1
    c=a
    d=b
    while d!=0:
        if d%2==1:
            x=multi(x,c)
        c=(c**2)%base
        d=d//2
    return x

def div(a,b):
    return(multi(a,exp(b,base-2)))


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


X={}

for i in range(1,N+1):
    X[i]=0

for i in range(N+1):
    if i==0 or i==1:
        continue
    if i in X:
        X[A[i-2]]+=1
    else:
        X[A[i-2]]=1
        
for i in X.values():
    print(i)

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

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

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

for r in rel[1:]:
    print(r)

Solution (Python):

from collections import defaultdict

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

n = inp()
nums = inlt()
num_dict = defaultdict(int)
for i in range(n - 1):
    num_dict[nums[i]] += 1

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

Solution (Python):
import sys
import os
from io import BytesIO, IOBase






'''def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * p, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r'''


'''def divs(n, start=1):
    divisors = []
    for i in range(start, int(n**.5) + 1):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return len(divisors)'''


'''def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
    return divs_number'''


'''def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)'''


'''def xor1_n(n):
    d={0:n,1:1,2:n+1,3:0}
    return d[n&3]'''

def cel(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return defaultdict(int)
def ddl(): return defaultdict(list)
def ddd(): return defaultdict(defaultdict(int))



BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
            while True:
                    b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
                    if not b:
                            break
                    ptr = self.buffer.tell()
                    self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
            self.newlines = 0
            return self.buffer.read()

    def readline(self):
            while self.newlines == 0:
                    b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
                    self.newlines = b.count(b"\n") + (not b)
                    ptr = self.buffer.tell()
                    self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
            self.newlines -= 1
            return self.buffer.readline()

    def flush(self):
            if self.writable:
                    os.write(self._fd, self.buffer.getvalue())
                    self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
            self.buffer = FastIO(file)
            self.flush = self.buffer.flush
            self.writable = self.buffer.writable
            self.write = lambda s: self.buffer.write(s.encode("ascii"))
            self.read = lambda: self.buffer.read().decode("ascii")
            self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

from collections import defaultdict 


from math import gcd,pi















n=ii()
a=li()
d=dd()
for i in a:
    d[i]+=1
for i in range(1,n+1):
    print(d[i])

Solution (Python):


MOD = 10**9
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

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

d = {}

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

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

for k, v in d.items():
    print(v)

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


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

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

for i in range(N-1):
    b_l[a_l[i]-1] += 1


for i in range(N):
    print(b_l[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):
from collections import Counter

n = int(input())
s = map(int, input().split())
c = Counter(s)
print("\n".join(map(str, (c.get(i + 1, 0) for i in range(n)))))

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

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

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

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

Staff_Count = [0] * (N + 1)

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

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

Solution (Python):
import collections

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

c = collections.Counter(A)

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

Solution (Python):

import sys
input = sys.stdin.readline





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 a in A:
    ans[a-1] += 1

for a in ans:
    print(a)

Solution (Python):

n = int(input())
a = list(map(lambda x: int(x) - 1, input().split()))
mng = [0 for _ in range(n)]
for i in a:
    mng[i] += 1

for i in mng:
    print(i)

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

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

from collections import Counter

b = Counter(a)

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

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


resulti = [0]*len(Ai)
for i in range(len(Ai)):
    resulti[Ai[i]-1]+=1

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

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

for i,v in enumerate(ls):
    d[v]+=1

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

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

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

Solution (Python):
from collections import Counter
N=int(input())
A=list(map(int, input().split()))
ans=[0]*N
for i,a in enumerate(A):
    ans[a-1]+=1
print(*ans,sep="\n")

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

list=[0]*(n)

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

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

Solution (Python):
import sys, math
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    A = [0, 0] + list(map(int, input().split()))

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


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
dic = {}
n = int(input())
a = [int(x) for x in input().strip().split()]

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

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

res = [len(dic[i]) for i in range(1,n+1)]
for r in res:
    print(r)

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

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

c = Counter(nums)
ans = [0] * n
for k, v in c.items():
    ans[k - 1] = v

for a in ans:
    print(a)

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

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

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

s = [0]*(n+10)
for a in A:
    s[a-1] += 1

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

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

Solution (Python):
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n=int(input())
l=list(map(int,input().split()))
a=[0]*n

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

Solution (Python):

n=int(input())
a=list(map(int,input().split()))
from collections import defaultdict as dd
d=dd(int)
for aa in a:
  d[aa]+=1
for i in range(n):
  print(d[i+1])

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

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

Solution (Python):
from collections import defaultdict


num_people = int(input())
rel = list(map(int, input().split()))
d = defaultdict(int)

for r in rel:
    d[r-1] += 1

for i in range(0, num_people):
    print(d[i])

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())

def LI(): return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    joushi = [0] * N
    for a in A:
        a -= 1
        joushi[a] += 1
    print("\n".join(map(str, joushi)))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  
    solve(N, A)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

n, *a = map(int, sys.stdin.read().split())
graph = [[] for _ in range(n)]
for i in range(n - 1):
    graph[a[i]-1].append(i)
def main():
    for i in range(n):
        print(len(graph[i]))


if __name__ == '__main__':
    main()

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

if __name__ == '__main__':
    main()

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

Solution (Python):
N = int(input())
ans = [0] * N
A = [int(i.strip()) for i in input().split(' ')]

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

b = [0]*n

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

for i in b:
    print(i)

Solution (Python):
import math

N = int(input())





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

temp = [0]*N

for M in Ms:
    temp[M-1] += 1

for M in temp:
    print(M)

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

c_list=[0]*N
for a in a_list:
    c_list[a-1]+=1


for c in c_list:
    print(c)

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

freq = {}
for e in arr:
    freq[e] = freq.get(e, 0) + 1

for i in range(1, n+1):
    print(freq.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):


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

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

    for c in a:
        b[c-1] += 1

    for d in b:
        print(d)

if __name__ == '__main__':
    main()

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

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

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

for c in cnt:
    print(c)

Solution (Python):


from collections import defaultdict


def main():
    n = int(input().strip())
    a_list = map(int, input().split())

    b_2_e = defaultdict(int)
    for i, a in enumerate(a_list):
        emp_i = i + 2
        b_2_e[a] += 1

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


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
N = int(input())
An = [int(i) for i in input().split()]
nums = [0 for _ in range(N)]

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

for n in nums:
  print(n)

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

Solution (Python):

import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
l = list(map(int, input().split()))
ANS = [0]*N

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

Solution (Python):
def slove(n, a):
    
    count = [0]*(n+1)
    for x in a :
        count[x] +=1

    for i in count[1:]:
        print(i)
    
if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    slove(n, a_list)

Solution (Python):
import sys
from math import pi



Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 998244353



n= int(ri())
a = Ri()
dic  = {}
for i in a:
    if i in dic:
        dic[i]+=1
    else:
        dic[i] = 1

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

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

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

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

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

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

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

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

j=[0]*n

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

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

Solution (Python):
N = int(input())
*A, = map(int, input().split())
d = {}


for i in range(1,N+1,1):
    d[i] = 0
for i in range(N-1):
    boss = A[i]
    if d[boss]!=0:
        d[boss] += 1
        continue
    d[boss] = 1


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

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

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

Solution (Python):
n = int(input())
seq = [int(x) for x in input().split()]
ans = [0 for _ in range(n)]
for val in seq:
    ans[val-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 range(N-1):
  ans[A[i]-1] += 1
for j in range(N):
  print(ans[j])

Solution (Python):



import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N = i2n()
    A = i2nn()
    B = [0] * N
    for a in A:
        B[a - 1] += 1
    for b in B:
        print(b)
    return

main()

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

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

from collections import Counter

a_L = Counter(a_L)

dic = {}
for i,v in a_L.items():
    dic[i] = v

for i in range(n):
    try:
        print(dic[i+1])
    except:
        print(0)

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

ans=[]
x=dict()
for i in range(N):
    x[i]=0

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

for idx in x:
    print(x[idx])