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

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

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

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

Solution (Python):
from collections import Counter 

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

Solution (Python):
import collections

N = int(input())
A = input().split(sep=' ')
A_list = []
for i in A:
    A_list.append(int(i))

c = collections.Counter(A_list)

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

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

for i in range(len(syain)):
  dic[syain[i]] += 1

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

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

from collections import Counter

cnt = Counter(A)

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):
import collections
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    A.append(i)
ans = collections.Counter(A)
tmp = sorted(ans.items())
for i in range(N):
    print(tmp[i][1]-1)

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

Solution (Python):
def main():
    n = int(input())
    i = list(map(int, input().split()))
    l = [0] * n
    for k in i:
        l[k-1] += 1
    for j in l:
        print('{}'.format(j))

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import collections
import numpy as np

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

answer = np.zeros(n ,dtype=int)
for number in l:
  answer[number-1] += 1


for j in range(n):
  c = round(answer[j])
  print(c)

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

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

Solution (Python):

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

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

for b in B:
    print(b)

Solution (Python):
N = int(input())
sum = 0
now = 1
for i in sorted(list(map(int,input().split()))):
    if(now == i):
        sum += 1
    else:
        print(sum)
        for j in range(i-now-1):
            print(0)
        now = i
        sum = 1
else:
    print(sum)
while(now < N):
    now += 1
    print(0)

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

employees = list(map(int, input().split(" ")))

subordinates = [0] * N

for employee in employees:
    subordinates[employee-1] += 1
    
for i in range(N):
    print(subordinates[i])

Solution (Python):
from collections import Counter
n = int(input())
l = list(input().split())
c = Counter(l)
for i in range(1, n+1):
    if c[str(i)]:
        print(c[str(i)], sep=' ')
    else:
        print(0, sep=' ')

Solution (Python):
N = int(input())
syain = []
for i in range(N):
	syain.append(0)
x =(input()).split(" ")
xid = [int(s) for s in x]
for t in xid:
	syain[t-1]+=1
for m in syain:
	print(m)

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

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

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

Solution (Python):
import collections

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

c = collections.Counter(M)



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

Solution (Python):
from collections import defaultdict

sh = int(input())
b = input()

id = [int(n) for n in b.split(" ")]
D = defaultdict(int)
for i in id:
    if i not in D:
        D[i] = 1
    else:
        D[i] += 1


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

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

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

N_map = {}

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

for i in A:
    if i in N_map:
        N_map[i] += 1

for i in N_map.values():
    print(i)

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

Solution (Python):
from collections import Counter


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



c=Counter(a)
ck=set(Counter(a).keys())
for i in range(1,n+1):
    if i in ck:
        print(c[i])
    else:
        print(0)

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()))
boss = [0] * N
for i in A:
    boss[i-1] += 1
print(*boss, sep='\n')

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

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

[print(i) for i in res]

Solution (Python):


n = int(input())

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

from collections import Counter

cntr = Counter(worker_nums)

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

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

Solution (Python):

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

A.sort()
if A[0]==0:
    A.remove(0)

l=len(A)
k=0

ans=1

m=max(A)

for i in range(l-1):
    if A[i+1]>A[i]:
        k=A[i]
        print(ans)
        while A[i+1]!=k+1:
            k=k+1
            print(0)
        ans=1
    else:
        ans=ans+1
if A[l-1]==A[l-2]:
    print(ans)
else:
    print(ans)
    
   
for j in range(m+1,N+1):
    print(0)

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

Solution (Python):
import collections

N=(int(input()))

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



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

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

Solution (Python):
import sys
from collections import defaultdict

lines = sys.stdin.read().splitlines()

total_num_employee = int(lines[0])
list_of_zyoshi = lines[1].split()
num_of_buka = defaultdict(int)
result = ""
for zyoshi_id in list_of_zyoshi:
    num_of_buka[zyoshi_id] += 1

for employee_id in range(1, total_num_employee + 1):
    result += str(num_of_buka[str(employee_id)]) + "\n"
print(result)

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

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())
A = sorted(list(map(int, input().split())))
least = 1
result = [0] * N
for a in A:
    result[a-1] += 1
    if a != least:
        least = a

for r in result:
    print(r)

Solution (Python):
import collections
N = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
i = 1
while i < N+1:
  print(c[i])
  i+=1

Solution (Python):
def main():
    N = int(input())
    E = {}
    A = input()
    for _, a in enumerate(map(lambda i: int(i)-1, A.split(' '))):
        E[a] = E.get(a, 0) + 1

    for i in range(N):
        print(E.get(i, 0))

main()

Solution (Python):
from collections import Counter

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

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

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

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

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

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

k=0
t=1
a=collections.Counter(A)
for i in range(1,N+1):
    print(a[i])

Solution (Python):

N = int(input())

s = input()
t = s.split(" ")

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



for i in range(len(t)):
    ans[int(t[i])-1]=ans[int(t[i])-1]+1

for i in ans:
    print(i)

Solution (Python):
import collections
n = int(input())
li = list(map(int, input().split()))
cnt = dict(collections.Counter(li))
for i in range(1,n+1):
    print(cnt.get(i, 0))

Solution (Python):


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

Solution (Python):
from collections import deque

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


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

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

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


resolve()

Solution (Python):
from collections import Counter

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

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

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

import collections

N = int(input())

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

c = collections.Counter(l)

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

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

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

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

for l in range(N):
  print(a[l])

Solution (Python):
import collections
n=int(input())
A=list(map(int,input().split()))
cli=collections.Counter(A)
for i in range(1,n+1):
    print(cli[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):
import collections

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

ans = [0] * n;

c = collections.Counter(A)
key = list(c.keys());
value = list(c.values());

for i in range(len(key)):
    ans[key[i]-1] = value[i];
  
for a in ans:
  print(a);

Solution (Python):
N = int(input())
a_list = list(map(int, input().split()))
a_list = [ (i+2, s) for i, s in enumerate(a_list) ]
a_list = sorted(a_list, key=lambda x: x[1])
count = 0
boss = 1
for a in a_list:
    if a[1] == boss:
        count += 1
    else:
        diff = a[1] - boss
        for _ in range(diff):
            print(count)
            count = 0
        boss = a[1]
        count += 1

for _ in range(N - a_list[-1][1]+1):
    print(count)
    count = 0

Solution (Python):
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):
import collections
a = int(input())
num = list(map(int,input().split()))
c = collections.Counter(num)
list(map(lambda x: print(c[x]), range(1,a+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()))
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):
num=int(input())
date=input().rstrip().split(" ")
list0=[]
for i in range(num-1):
  list0.append([])
for j in range(num-1):
  list0[int(date[j])-1].append(0)
for k in range(num-1):
  print(len(list0[k]))
print(0)

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

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()]
answer = [0] * N
for i in range(1,N):
    x = a[i-1]
    answer[x-1] +=1

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

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

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

Solution (Python):
n = int(input())
s = input().rstrip().split(' ')
length = len(s)
lst = [0] * n
for i in range(length):
  m = int(s[i])
  lst[m-1] += 1
for j in range(n):
  print(lst[j])

Solution (Python):

n= int(input())
arr = list(map(int,input().split()))
keys = []
for _ in range(1,n+1):
    keys.append(_)


values = [0]*(n+1)
dic = {k: v for k, v in zip(keys, values)}

for i in range(n-1): 
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1

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

Solution (Python):

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

Solution (Python):
import numpy as np


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

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

    for c in counter:
        print(int(c))


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(n):
    print(c[i+1])

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

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
for j in range(len(b)):
  print(b[j])

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

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

for i in range(N-1):
    ans[(arr[i])-1] += 1

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

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

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

workerList = {}

for single in range(pepole):
  workerList[single + 1] = 0

for single in range(len(boss)):
  workerList[boss[single]] += 1

for single in range(len(workerList)):
  print(workerList[single + 1])

Solution (Python):
from collections import Counter, deque
n = int(input())
a = deque(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):

n = int(input())
a = input().split()
lis = [0 for i in range(n)]

for i in a:
    lis[int(i) - 1] += 1

for i in lis:
    print("{}".format(i))

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

ans = [0] * N

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

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

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

Solution (Python):
def void(arg_num):
    return arg_num

def get_input_list(func=void):
    inp_str = input()
    return list(map(func, inp_str.split(" ")))


N = int(input())
a_list = get_input_list(int)

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

for a in a_list:
    ans_list[a - 1] += 1

for ans in ans_list:
    print(ans)

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

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

for i in A:
    L[i] += 1

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

Solution (Python):

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


from collections import Counter
jousi_0 = {i:0 for i in range(1,N+1)} 
jousi = Counter(A) 

for i,v in jousi.items(): 
    jousi_0[i] = v

for i in jousi_0.values():
    print(i)

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

d = {}
for i in range(0,n-1):
  if a[i] in d:
    d[a[i]] += 1
  else:
    d[a[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())
l_a = list(map(int, input().split()))
k_a = collections.Counter(l_a)

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

Solution (Python):
from collections import defaultdict

N = input()
M = input().split()

a = defaultdict(int)
for i in M:
    a[int(i) - 1] += 1

for i in range(int(N)):
    print(a[i])

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

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

i = 0
for target_val in range(1, n + 1):
    cnt = 0
    while target_val == a_list[min(i, len(a_list) - 1)] and i < len(a_list):
        i += 1
        cnt += 1
    print(cnt)

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

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 c[i]:
        print(c[i])
    else:
        print(0)

Solution (Python):
import collections
N = int(input())
A = [int(i) for i in input().split()]
c = collections.Counter(A)
c = c.most_common()
c.sort()
cnt = 0
for i in range(N):
  try:
    num = c[cnt][0]
    tmp = c[cnt][1]
    if num == i+1:
      print(tmp)
      cnt += 1
    else:
      print(0)
  except:
    print(0)

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

a = [0]*N
for i in range(len(A)):
    a[A[i]-1] += 1
    
for j in range(len(A)):
    print(a[j])
print(0)

Solution (Python):
import numpy as np

N = int(input())
A = np.asarray(list(map(int,input().split())))
A_sort = np.sort(A)

k = 0
for i in range(1,N+1):
    count = 0
    for j in range(k,N-1):
        if A_sort[j] == i:
            count += 1
        else:
            break
    print(count)
    k += count

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

for i in B:
    print(i)
print(0)

Solution (Python):
import collections

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

c = collections.Counter(b)

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

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

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

ans=[0]*(len(A)+1)


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

for i in ans:
  print(i)

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

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

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

Solution (Python):
def main():
    from collections import Counter
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    
    ans = Counter(A_list)

    for n_cycle in range(N) :
        n_cycle = n_cycle + 1
        
        print(ans[n_cycle])

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

Solution (Python):
import numpy as np


def solve():
    num_so = np.array([0] * (len(a)+1))
    so = [[] for i in range(len(a)+1)]
    for i in reversed(range(len(a)+1)):
        num_so[i] = len(so[i])
        if i!=0:
            chief = a[i-1]-1
            so[chief].append(i)
            
    
    for nu in num_so:
        print(nu)
    return




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

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 a:
    tmp=int(i)-1
    ans[tmp]=ans[tmp]+1
  for j in range(n):
    print(ans[j])
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):
    if i in C.keys():
        print(C[i])
    else:
        print(0)

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

Solution (Python):
import collections

def main(N, A):
    c = collections.Counter(A)
    [print(c[i+1]) for i in range(max(c.keys()))]
    [print(0) for i in range(max(c.keys()), N)]

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    
    
    main(N, A)

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

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
for i in range(len(B)):
    print(B[i])

Solution (Python):

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

Solution (Python):
from collections import Counter

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

res = Counter(A)

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

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

l = [0] * N
for a in A:
    l[ a - 1 ] += 1
for b in l:
    print( b )

Solution (Python):

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

for i in ans:
    print(i)

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

    import collections

    C = collections.Counter(A)
    m = max(A)
    for i in range(m):
        print(C[i+1])

    for _ in range(N-m):
        print(0)


if __name__ == '__main__':
    main()

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

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

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


counter = Counter(b)
list = ""
for i in range(a+1):
  if i == 0:
    list = list
  elif i>=1:
    list += str(counter[i])+"\n"

print(list)

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

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

for k in range(N):
    ans.append(0)

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

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

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

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

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

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

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

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

tmp = ar.pop(0)
ar.append(tmp)
for i in range(n):
    print(ar[i])

Solution (Python):

import sys


def solve(N: int, A: "List[int]"):
    sub = [0]*N

    for i in range(N-1):
        sub[A[i]-1] += 1
    print(*sub,sep='\n')
    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
input = sys.stdin.readline

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

    a_dict = {}

    for a in a_li:
        if str(a) in a_dict:
            a_dict[str(a)] += 1
        else:
            a_dict[str(a)] = 1

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
from collections import Counter

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

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

h = [0] * n
for i in l:
    h[i - 1] += 1

for i in h:
    print(i)

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

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

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

Solution (Python):
from collections import defaultdict
dpa = defaultdict(lambda: 0)

n = int(input())

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

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

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

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

Solution (Python):
a=input()
b=input()

N=int(a)
An=b.split(' ')

import numpy as np
C=np.zeros(N+1)
for ai1 in An:
    C[int(ai1)] += 1

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

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

c = Counter(a)
for i in range(n):
    print(c[i + 1])

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

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


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)


def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
    
    (n, ) = [int(e) for e in lines[0].split(" ")]
    a = [int(e) for e in lines[1].split(" ")]

    return (n, a)


def solve(n, a):

    result = dict([(i, 0) for i in range(1, n+1)])

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

    return  list(result.values())


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()