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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
cnt=[0]*200005
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())
List=list(map(int,input().split()))

L=[]
for i in range(n):
  L.append(0)
  
i=0
for i in range(n-1):
  cnt=List[i]
  L[cnt-1]=L[cnt-1]+1
  
for List in L:
  print(List)

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

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

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

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

for i in range(N):
  print(str(L[i]))

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

result = [0] * N
for a in A:
    result[a - 1] += 1
print('\n'.join(map(str, result)))

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

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

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

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

Solution (Python):
def main():
  N = int(input())
  As = list(map(int, input().split()))
  
  ans_list = [0] * N
  
  for i in As:
    ans_list[i - 1] += 1
   
  for i in range(N):
    ans = ans_list[i]
    print(ans)

if __name__ == "__main__":
  main()

Solution (Python):
import collections

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

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

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

sub_list = [0] *n

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

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

Solution (Python):
import sys

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

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

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

for c in count:
	print(c)

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

arr = [0] * N

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

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

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

Solution (Python):
def main():
    a = int(input())
    b = list(map(int, input().split()))
    c = [0]*a
    for i in b:
        c[i-1] += 1
    for j in c:
        print(j)
if __name__ == '__main__':
    main()

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

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

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

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

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

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

print(*ans)

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

ans = [0] * n

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

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

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

b = [0] * n

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

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

Solution (Python):
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ansarray = []
ansnum = 1
ans = 0
ansindex = 0
for i in range (1,N):
    for j in range(ansindex,N-1):
        if (array[j] == i):
            ans += 1
            ansindex += 1
        else:
            ansarray.append(ans)
            ans = 0
            break
        if(j == N-2):
            ansarray.append(ans)
            ansindex += 1
for i in range(N-len(ansarray)):
    ansarray.append("0")
for i in range(N):
    print(ansarray[i])

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

Solution (Python):
import collections

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

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

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

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

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

a = []
s = [0] * n
a.append(input().split())

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

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

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

Solution (Python):

N = int(input())

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

ans = 0
  
  
ans_list = [0]*N
  
for i in range(len(A_list)):
  
  ans_list[A_list[i]-1]+=1


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

Solution (Python):
import sys
import collections
input = sys.stdin.readline
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()))
ls=[0]*n

for i in a:
  ls[i-1]+=1
for i in ls:
  print(i)

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

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

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

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

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

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

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

Solution (Python):
import collections

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

A_cnt = collections.Counter(A)

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

Solution (Python):
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ansarray = []
ansnum = 1
ans = 0
ansindex = 0
for i in range (1,N):
    for j in range(ansindex,N-1):
        if (array[j] == i):
            ans += 1
            ansindex += 1
        else:
            ansarray.append(ans)
            ans = 0
            break
        if(j == N-2):
            ansarray.append(ans)
            ansindex += 1
for i in range(N-len(ansarray)):
    ansarray.append("0")
for i in range(N):
    print(ansarray[i])

Solution (Python):
import collections

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

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

ans = [0] * n

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

print(*ans)

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 collections

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

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

Buka_list = []

for i in range(N):
    Buka_list.append(0)
    
for j in A_list:
    Buka_list[j-1] += 1

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

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



dct = Counter(lst)
for i in range(1, n+1):
  print(dct[i])

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

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

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

AnStr = input().split(' ')
zyosiList = []
a = {}
for v in AnStr:
  zyosiList.append(int(v))
  if v in a:
    a[v] += 1
  else:
    a[v] = 0

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

Solution (Python):

import sys




import numpy as np



"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        
        
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def main():
    
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    
    
    
    
    
    n = int(input())
    a = np.array(ip.IL())
    
    b = np.bincount(a)[1:]
    m = len(b)
    others = np.zeros(n-m).astype(int)
    
    print('\n'.join(map(str, b)))
    print('\n'.join(map(str, others)))
    

main()

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

Solution (Python):
import collections
M = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
num = 1

while num <= M:
    print(B[num])
    num += 1

Solution (Python):
from collections import Counter


def main():
    N = int(input()) 
    An = list(map(int, input().split(' '))) 
    
    
    
    
    
    
    an = Counter(An)
    for n in range(1, N+1):  
        print(an[n])
            


    
main()

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

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

print(*ans)

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

for i in range(0, len(A)):
    M[(A[i]-1)] += 1
    i += 1

for j in range(0, N):
    print(M[j])
    j += 1

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

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

Solution (Python):
import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    A = list(map(int, rl().split()))
    
    counter = defaultdict(int)
    for ai in A:
        counter[ai] += 1
    for i in range(1, N + 1):
        print(counter[i])


if __name__ == '__main__':
    solve()

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

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

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

Solution (Python):
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))

c = collections.Counter(x)
for i in range(1,n):
    print(c[i])
print(0)

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

Solution (Python):
from sys import stdin
import collections

def main():
    readline = stdin.readline
    N = int(input())
    A = list(map(int, readline().split()))
    listN = list(range(1, N+1))    
    c = collections.Counter(A)
    
    for i in listN:
        print(c[i])
main()

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

Solution (Python):
i= int(input())
l=list(map(int, input().split()))
time=[]
for i in range(i):
  time.append([])
for i in l:
  
  time[i-1].append(i)
  
for i in time:

  print(len(i))

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

Solution (Python):
import collections

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

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

N = int(input())
A = list(map(lambda x: int(x)-1, input().split()))
dic = {}
for a in A:
    dic[a] = dic.get(a, 0)+1
for i in range(N):
    print(dic.get(i, 0))

Solution (Python):

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

list = [0] * (N + 1)
for i in range(0, N - 1):
    a = P[i]
    list[a] += 1
for i in range(1, N + 1):
    print(list[i])

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

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

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

c = collections.Counter(a)
for value in range(n):
    if value == 0:
        continue
    else:
        print(c[value])
print(0)

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

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

Solution (Python):
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    N = int(input())
    A = read_list()
    D = {}
    for a in A:
        D[a] = D.setdefault(a, 0) + 1
    
    for n in range(1, N + 1):
        print(D.setdefault(n, 0))


if __name__ == "__main__":
    main()

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

mycounter = Counter(A)

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

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

c = collections.Counter(a)

for s in range(1,N):
    if s in c:
        print(c[s])
    else:
        print("0")
print("0")

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

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

print(0)

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

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





b = [0] * n

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

for f in b:
  print(f)

Solution (Python):
from sys import stdin, setrecursionlimit, stdout

from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return list(mi())
def lsi():
    x=list(stdin.readline())
    x.pop()
    return x
def si(): return stdin.readline()
mod=1000000007
res=['YES', 'NO']

n=ii()
p=[0]*(n+1)
a=li()
for i in a:
    p[i]+=1
for i in p[1:]:
    print(i)

Solution (Python):
import collections
n=int(input())
a=list(map(int,input().split()))
m=max(a)
c=collections.Counter(a)
c=c.most_common()
l=[0]*n
for i in range(len(c)):
    l[c[i][0]-1]=c[i][1]
print(l[0])
for j in range(1,n):
    print(l[j])

Solution (Python):
def main():
  import collections
  x = int(input())
  y = [int(t) for t in input().split()]
  c = collections.Counter(y)
  for i in range(x):
  	print(c[i+1])
main()

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 = list(int(i) for i in input().split())
lst = [0] * (n + 1)

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

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

Solution (Python):
l=[list(map(int,input().split())) for _ in range(2)]
managementlist=[]
for i in range(l[0][0]):
    managementlist.append(0)
for j in range(l[0][0]-1):
    managementlist[l[1][j]-1]+=1
for k in range(l[0][0]):
    print(managementlist[k])

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

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

boss_count_list = [0] * n


for val in boss_list:
  boss_count_list[val - 1] += 1

for val in boss_count_list:
  print(val)

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

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

Solution (Python):
N = int(input())
S = map(int, input().split())
s_dict = {i:0 for i in range(1, N+1)}
for s in S:
    s_dict[s] += 1
for i in range(1, N+1):
    print(s_dict[i])

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

dp = [0] * a
for i in l:
    dp[i-1]+=1
for i in dp:
    print(i)

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

ans = []
for i in range(N): ans.append(0)

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

for i in ans: print(i)

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

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
data = [0 for _ in range(n+1)]
for x in a:
    data[x]+=1
for x in data[1:]:
    print(x)

Solution (Python):
num = int(input())
hoge = list(map(int, input().split()))

fuga = [0] * num

for i in hoge:
  fuga[i - 1] += 1
for i in fuga:
  print(i)

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):
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 = input().split()

import collections
c = collections.Counter(A)

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

Solution (Python):
n=int(input())
boss=[int(x) for x in input().split()]
mem=list(range(1, n+1))
h_map = dict.fromkeys(mem, 0)
for i in boss:
    h_map[i]+=1

for i in mem:
    print(h_map[i])

Solution (Python):
import numpy as np

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num,dtype=np.int16))

for x in sup_num:
  yn_num[x-1] +=1
for x in yn_num:
  print(x)

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

p = [0] * n

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

for i in p:
  print(i)

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

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
c={}
for i in range(len(b)):
    try:
        c[b[i]]+=1
    except KeyError:
        c[b[i]]=1

    
for i in range(a):
    try:
        print(c[i+1])
    except KeyError:
        print(0)

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

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

for i in ans:
    print(i)

Solution (Python):
N = int(input())
A = 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)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
 
N = int(input())
A = [int(x) for x in input().split()]
cnt = [0] * N
for i in range(N-1):
    cnt[A[i]-1] += 1
for i in range(N):
    print(cnt[i])

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


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

dic={}
for e in A:
    if e in dic:
        dic[e]+=1
    else:
        dic[e]=1
        
for i in range(1,N+1):
    if i in dic:
        print(dic[i])
    else:
        print(0)

Solution (Python):
from collections import defaultdict
n=int(input())
ar=list(map(int,input().split()))
d=defaultdict(int)
for i in ar:
  d[i]+=1
for i in range (1,n+1):
  if i in d.keys():
    print(d[i])
  else:
    print(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):
import sys
import os
import math

def file_input():
    f = open('input.txt', 'r')
    sys.stdin = f

def main():
    

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

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

    for i in N:
        print(i)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
A = input().split()
a = [int(i) for i in A]
b = [0]*n

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

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

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 A:
    dic[i] += 1
for ans in dic.values():
    print(ans)

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

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

Solution (Python):
n = int(input())
data = [int(i) for i in input().split()]
ans = [0 for i in range(n)]
for who in data:
  ans[who-1] += 1
for num in ans:
  print(num)

Solution (Python):

from collections import Counter

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

ans = []

ans = [0] * member

mycounter = Counter(mem_number)

for i in range(member):
  ans[i] = mycounter[i+1]
  print(ans[i])

Solution (Python):
import collections
N = int(input())
t = list(map(int, input().split()))

C = collections.Counter(t)
for i in range(N):
    print(C[i+1])

Solution (Python):

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

count = 0
for i in range(N-1):
    L = len(A)
    
    Ans = 0
    count += Ans
    for j in range(L-count):
        if A[count + j]==i+1:
            Ans += 1
        else:            
            break
    print(Ans)
    count += Ans

        
print("0")

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

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




r_list = collections.Counter(a_list)
y = []
for i in range(1,(n+1)):
    if (i in r_list):
        y.append(r_list[i])
    else:
        y.append(0)

r_list2 = map(str, y)
r_list2 = list(r_list2)
ans = "\n".join(r_list2)
print(ans)

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

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

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

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

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

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

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

Solution (Python):
import sys

def main():

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

if __name__ == "__main__":
    main()

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