peterverebics/CodeNet_Python_118 huggingface dataset:
n = int(input())
a = list(map(int, input().split(" ")))

cursor = 1
counter = 0

for i in range(0, n - 1):
    if a[i] == cursor:
        counter += 1
    elif a[i] > cursor:
        print(counter)
        for j in range(cursor + 1, a[i]):
            print(0)
        cursor = a[i]
        counter = 1

print(counter)
for i in range(cursor + 1, n + 1):
    print(0)
n = int(input())
a = list(map(int, input().split()))

i = int(1)
while i <= n:
    a.count(i)
    i = i + 1
in1 = input()
A = input().split(" ")
for i in range(1, int(in1)):
    sum = 0
    for j in A:
        if int(j) == i:
            sum += 1
    print(sum)
s=int(input())
e_list=list(map(int,input().split()))
 
m_list=[]
for i in range(1,s):
  a=e_list.count(i)
  m_list.append(a)

for j in m_list:
 print(m_list[s-2-j])
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(len(a)):
    ans[i-1] += 1
for i in range(len(a)):
    print(ans[i])
N = input()
S = input().replace(" ","")
 
for A in range (int(N)-1):
    print(S.count(str(A+1),A,int(N)-2))

print(0)
N =int(input())
A = list(map(int, input().split()))
B=[0]*(N-1)
k=0
t=1
for i in range(0,N-1):
    if A[i]==t:
        k+=1
    else:
        print(k)
        k=1
        for j in range(t+1,A[i]):
            print(0)
        t = A[i]
for i in range(t,N+1):

    print(k)
    k=0
from sys import stdin
input = stdin.readline
N=int(input())
A = list(map(int, input().split()))
for n in range(N):
    print(A.count(str(n+2)))
N = int(input())
A = list(map(int,input().split()))

count = 1

print(A.count(count))

for i in range(N-1):
    if count == A[0]:
        count += 1
        print(A.count(count))
        del A[0]
    else:
        print(0)
n = input()
a = list(map(int, input().split()))

print(0)
for i in range(len(a)):
    print(a.count(i))
N=int(input())
A=list(map(int,input().split()))
s=[]
for i in range(N-1):
  b=A.count(i+1)
  s.append(b)
for j in range(N-1):
  print(s[j])
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N):
  count = 0
  for i in range(1,N):
    if A[i-1] == i:
      count += 1
  print(count)
print(0)
N = int(input())
A = sorted(list(map(int,input().split())))
L = [0]*(N+1)
for i in range(N-1):
  L[A[i]] += 1
for l in L:
  print(l)
N = int(input())
A = sorted(list(map(int, input().split())))
least = A[0]
count = 0
result = []
for a in A:
    if a == least:
        count += 1
    else:
        result.append(count)
        least += 1
        count = 1
result.append(count)

length = len(result)
for i in range(N-length):
    result.append(0)

for r in result:
    print(r)
n = int(input())

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

import collections
c = collections.Counter(a)

print(c[1])
for i in range(n-1):
    num = a[i]
    print(c[num+1])
n = int(input())
boss_list = list(map(int, input().split(" ")))


buka_list = []

for i in range(n):
    buf_counter = boss_list.count(i + 1)
    if i == 0:
        buf_counter -= 1

    buka_list.append(buf_counter)

for val in buka_list:
    print(val)
#Aiの数字を数え上げればいい

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

for k in range(1,n):
    print(a.count(k))
N = int(input())
A = sorted(list(map(int, input().split())))
least = A[0]
count = 0
result = [0] * N
for a in A:
    if a == least:
        count += 1
    else:
        result[a-1] = count
        least += 1
        count = 1
if result[0] == 0:
    result[0] = count

length = len(result)
for i in range(N-length):
    result.append(0)

for r in result:
    print(r)
N = input()
A = input().split()

for i in range(len(A)):
  print(A.count(str(i+1)))
n = int(input())
a = list(map(int, input().split()))

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

for i in range(n-1):
    b = a.count(i)
    print(b)
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

for i in range(n):
  print(sub_list[i])
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)
buka = [0 for i in range(n)]

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

for i in buka:
    print(i)
n=int(input())
a=list(map(int,input().split()))
 
for i in (1,n+1):
	print(a.count(i))
import collections

def main(N, A):
    c = collections.Counter(A)
    return list(c.values()) + [0 for i in range(N - len(c))]

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    # N = 7
    # A = list(map(int, "1 2 3 4 5 6".split()))
    [print(i) for i in main(N, A)]
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
b = np.zeros(n)
for i in a: b[i-1] += 1
for i in b: print(i)
N=int(input())
A=list(map(int,input().split()))
s=[]
for i in range(N-1):
  b=A.count(i+1)
  s.append(b)
for i in range(N-1):
  print(s[i])
N = int(input())
A = list(map(int, input().split()))

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

A.sort()

before = 0
tmp = 0
for i in range(N-1):
    if A[i] == before:
        tmp += 1
    else:
        print(tmp)
        before += 1
        tmp = 1

print(tmp)

for i in range(N-before):
    print(0)
from collections import Counter
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = dict(Counter(a))
c = list(b.keys())
c.sort()
d = [b[i] for i in c] + [0]
d1 = defaultdict(lambda:-1)
c = [0]+c[:]
for i,j in enumerate(d):
    d1[c[i]] = j
e = defaultdict(lambda: 1)
print(d[0])
for i in range(n-1):
    if e[a[i]]==1:
        e[a[i]]=0
        print(d1[a[i]])
    else:
        print(0)
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n-1):
  b[a[i]] += 1
  
for e in b:
  print(e)
import collections
N = int(input())
A = [int(i) for i in input().split()] 
c = collections.Counter(A)
c = c.most_common()
for i in range(N):
  try:
    tmp = c[i][1]
    print(tmp)
  except:
    print(0)
n = int(input())
a = list(map(int,input().split()))
b = set(a)
c = len(b)
for i in b:
    if i in a:
        num = a.count(i)
        print(num)
    elif not i in a:
        print(0)

for i in range(n-c):
    print(0)
N = int(input())
A = list(map(int,input().split()))

Clist = []
for count in range(len(A)+1):
    Clist.append(0)

for count in range(len(A)):
    Clist[A[count]-1] = Clist[A[count]-1] + 1

for count in range(0,len(A)):
    print(Clist[count])
n = int(input())
a = list(map(int, input().split()))
p = 0

for i in list(set(a)):
    ans = a.count(i)
    print(ans)
    p = p + ans
    a.remove(i)
    if p == n-1:
        break
for s in range (n-i):
    print(0)
N = int(input())
A = list(map(int,input().split()))

ans = [0]*N
for i in range(N-1):
    ans[A[i]] += 1
for i in range(1,N):
    print(ans[i])
num = int(input())
li = list(int(x) for x in input().split())
li2 = [0] * num
num = len(li)
for i in li:
  li2[i - 1] = li2[i - 1] + 1
for j in range(num):
  print(li2[j])
N = int(input())
A = list(map(int,input().split()))
A.insert(0,0)
             
print(A)

for i in A:
    print(A.count(i+1))
N=int(input())
Boss=list(map(int, input().split()))
Boss.insert(0, 0)
N_B=[]
for i in range(N):
    if Boss[i] in N_B:
        print("0")
    else:
        print(Boss.count(Boss[i]+1))
        N_B.append(Boss[i])
n=int(input())
a=[int() for i in input().split()]
for j in range(n-1):
	print(a.count(j))
a=int(input())
b=[0]*a
c=list(map(int,input().split()))
for i in c:
    b[i-0]+=1
print(*b,sep="\n")
# n = int("5")
# boss_list = list(map(int, "1 1 2 2".split(" ")))
n = int(input())
boss_list = list(map(int, input().split(" ")))

boss_list = sorted(boss_list)


for i in range(n):
    boss_num = 0
    boss_num = boss_list.count(i + 1)
    # boss_list = boss_list[boss_num:]
    del boss_list[:boss_num]

    if i == 0:
        boss_num -= 1

    print(boss_num)
n=int(input())
c=list(map(int,input().split()))
l=0
h=n
for i in range(1,n+1):
    for j in c:
        if i==j:
            l+=1
        else:
            print(l)
            h=h-1
            while l>0:
                c.pop(0)
                l=l-1
            l=0
            break
while h>0:
    print(0)
    h=h-1
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for q in range(n - 1):
    ans[a[q]] += 1
print(*ans[0:], sep="\n")
N = int(input())
AR = str(input()).split()

cnt = 1
under = []
for i in range(len(AR)):
  
  if i != 0:
    if AR[i] != retain:
      under.append(cnt)
      cnt = 1
    if AR[i] == retain:
      cnt += 1
  if i == (len(AR)-1):
    under.append(cnt)
  retain = AR[i]

add = len(AR) - len(under) + 1
for j in range(add):
  under.append(0)
  
for k in range(len(under)):
	print(under[k])
def q3():
    N = int(input())
    A = [int(i) for i in input().split()]
    for i in range(N-1):
        print(A.count(i+1))


if __name__ == '__main__':
    q3()
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    print(a.count(i))
N=int(input())
alist=list(map(int,input().split()))

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

for i in range(1,N+1):
  if i in answer_dic:
    print(answer_dic[i])
  else:
    print(0)
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    print(A.count(i))
import collections
n = int(input())
a = collections.Counter(list(map(int, input().split())))

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

for i in range(N-1):
  print(List.count(i+1))
print(0)
import math
N = int(input())
A = [int(elem) for elem in input().split()]
count = [0]*N
for i in A:
  count[i-1] = count[i-1]+1
  [print (i) for i in count]
n = int(input())
a = list(map(int, input().split()))
tm = 0

for i in range(1, n):
    tm = a.count(i)
    print(tm)
def main():
    N = int(input())
    A = list(map(int, input().split()))
    m = -1
    for i in range(1, N + 1):
        if m == 0:
            continue
        print(A.count(i))
        m = A.count(i)
main()
def main():
        N = int(input())
        A = list(map(int, input().split()))

        l = []
        last = A[N-2]

        for i in range(last):
                l.append(A.count(i+1))
        for i in range(N-last):
                l.append(0)

        [print(n) for n in l]
        #print(l)

if __name__=="__main__":
        main()
import collections

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

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

L=len(A)

for i in range(1,N):
    if i in A:
            A.remove(i)
            t=L-len(A)
            L=len(A)
            print(t)
    else:
        print(0)
n = int(input())
alist = list(map(int,input().split()))
print(alist)
num_b = [0]*(n+1)
for i in range(n-1):
    num_b[alist[i]] += 1 
for i in range(1,n+1):
    print(num_b[i])
#整数の入力
N = int(input())
#スペース区切りの整数の入力リスト
A_list = list(map(int, input().split()))

ans = 0
for i in range(len(A_list)):
  ans = A_list.count(i+1)
  print(ans)
n=int(input())
a=list(map(int, input().split()))

s=0
for i in a:
    print(a.count(s+1))
    s+=1
n = input()
num = map(int,input().split())

cnt = 0
work = 0
sum = 0
flg = 0
for i in num:
  if work != i:
    if work != 0:
      print(cnt)
      sum += 1
    cnt = 1
    work += 1
  elif work == i:
    cnt += 1

print(cnt)
sum += 1
sum = int(n) - sum
for i in range(sum):
  print(0)
N = int(input())
A = list(map(int, input().split()))

B = [0] * N

for i in A:
  B[i-1] = int(B[i-1]) + 1
  
print(B)
import collections
n=int(input())
a=list(map(int,input().split()))
dic=collections.Counter(a)
for i in range(1,n):
    if i in dic.keys():
        print(dic[i])
    else:
        print(0)
from collections import Counter
a=int(input())
b=input().split()
l=[]
for i in b:
  l.append(int(i))
counter = Counter(l)
la=list(counter.values())
l=[0]*(a-len(la))
lf=la+l
i=0
while i<a:
    print(lf[i])
    i+=1
from collections import Counter
a=int(input())
l=list(map(int,input().split()))
d=Counter(l)
print(d)
for i in range(1,a+1):
    if i in d:
        print(d[i])
    else:
        print("0")
N = int(input())
List = list(map(int,input().split()))
List2 = [0]*N
for i in range(N-1):
    List2[List[i-1]-1] += 1
print(List2)
from collections import Counter
n=int(input())
a=[int(i) for i in input().split()]
new=Counter(a)
for i in new.values():
    print(i)
[print(0) for i in range(1,n-len(new)+1)]
from collections import Counter
n = int(input())
Al = list(input().split())
count = Counter(Al)
print(count)
for i in range(n):
    if str(i + 1) in Al:
        print(count[str(i+1)])
    else:
        print(0)
n=int(input())
ali = input().split()

for i in range(n-1):
    print(ali.count(str(i+1)))
N=int(input())
A=[int(x) for x in input().split()]

print(A)
for i in range(N):
    sum=0
    for j in range(i,N-1):
        if A[j]==i+1:
            sum+=1

    print(sum)
num = int(input())
boss = input().split()

ans_list = [0] * num

for i_boss in boss:
  ans_list[int(i_boss)-1] += 1
  a = list(map(lambda  x: str(x), ans_list))
  print('\n'.join(a))
n = int(input())
e = list(map(int,input().split(" ")))
for i in e:
  print(e.count(i+1))
n = int(input())
mem = list(map(int, input().split()))

a = 0
cnt = 1
for i in range(n):
    for j in mem:
        if j==cnt:
            a+=1
            mem.remove(j)
    cnt += 1
    print(a)
    a = 0
from collections import Counter
n = int(input())
a = list(map(int,input().split()))

m = Counter(a)

for i in range(1,n):
  print(m[i])
in1 = input()
A = list(map(int, input().split()))
for i in range(1, int(in1)):
    print(A.count(i))
#N ≡ int(inport())
#lists = list(int,inport().split())
#print(lists.count(for_in range(N))
N = int(input())
lists = list(map(int,input().split()))
#print(lists.count( for X in range(N)))
for X in range(1,N):
    print(lists.count(X))
input_line = int(input())
ans = [0] * input_line

inputs = input().split(' ')
inputs = list(map(int, inputs))
for e in inputs:
  for i in range(1, input_line):
    if e == i:
      ans[i] += 1

for i in range(len(ans)):
  print(ans[i])
N = int(input())
A_i = list(map(int, input().split()))
num = 1
while num < N:
    print(A_i.count(num))
    num += 1
N = int(input())
A_List = list(map(int, input().split()))
i_before=1
i_count=0
i_put=0
for i in range(N-1):
  if(i_before==A_List[i]):
    i_count+=1
  else:
    print(i_count)
    i_put+=1
    i_count=1
  i_before=A_List[i]
  if(i==N-2):
    print(i_count)
    i_put+=1

for i in range(N-i_put):
  print('0')
n = int(input())
l = list(map(int, input().split()))
l.sort()
distinct_list = set(l)
count_list = []
count = 0
for d in distinct_list:
      count_list.append(l.count(d))
while count < n:
    if len(count_list) > count:
        print(count_list[count])
    else:
        print(0)
    count += 1
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[A[j]-1])
print(0)
n = int(input())
lst = list(map(int,input().split()))
ans = [0] * n

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

print(ans)
#!/usr/bin/evn python3

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

for i in range(1, N+1):
    ans = A.count(i)
    if ans > 0:
        print(ans)
    else:
        break
    cnt += 1
print('\n'.join(map(str, [0]*(N-cnt))))
N = int(input())
rel_list = map(int, input().split())

member_list = [0]*N
for rel in rel_list:
    member_list[rel-1] += 1

print([i for i in member_list])
N= int(input())
Alist = [int(i) for i in input().split()] 

count = 0

for j in range(1,N+1):
  for i in range(j-1,N-1):
    if Alist[i] == j:
      count += 1
    
    if Alist[i] > j:
      break
  
  print(count)
  count = 0
import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
A = list(map(int,input().split()))
countstop = False
for i in range(N+1)[1:]:
	if countstop:
		print(0)
		continue
	ni = A[i+1:].count(i)
	print(ni)
	N = N - ni
	if N == 1:
		countstop = True
n = int(input())
a = list(map(int, input().split()))

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

for v in result:
    print(v)
N = int(input())
A = list(map(int,input().split()))
A.append(0)
i = 0
while i<N:
    count = 0
    if A[i]==i+1:
        count+=1
    
    print(count)
    i+=1
import math

R = int(input())

ans = 2 * R * math.pi

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

l = len(set(a))

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

for i in b:
  print(i-1)
n = int(input())
alis = list(map(int, input().split()))
d = {}
for i in alis:
    if str(i) in d.keys():
        d[str(i)] += 1
    else:
        d[str(i)] = 1
for i in range(1,n+1):
    if str(i) not in d.keys():
        d[str(i)] = 0
print('\n'.join(map(str, d.values())))
n = int(input())
a = list(map(int,input().split()))

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

count = [0]*(N-1)

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

for i in count:
    print(i)
from collections import Counter

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

d = Counter(A)
zero = N - len(d)
print(d)
for k, v in d.items():
    print(v)
for i in range(zero):
    print('0')
import numpy as np

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num,dtype=np.int16))
print(yn_num)
for x in sup_num:
  yn_num[x-1] +=1
print(list(yn_num))
employeeCount = int(input())
DirectBosses = list(map(int, input().split()))

for em in range(employeeCount):
    directJuniorCount = 0

    # 自分のことを直属の上司だと言う社員は直属の部下
    for bo in DirectBosses:
        if em == bo :
            directJuniorCount += 1

    print(directJuniorCount)
import collections
N = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
print(B)
for i in range(1,N):
   print(B[i])
print('0')
N=int(input())
A=list(map(int, input().split()))
ans=[0]*N
for a in A:
  ans[a-1]+=1
print(ans)
N = int(input())
array = list(map(int, input().strip().split()))
array.sort
ans = 0
ansnum = 1
i = 0
for i in range (N-1):
    if (array[i] == ansnum):
        ans += 1
    else:
        print(ans)
        for i in range(array[i]-ansnum-1):
            print("0")
        ansnum = array[i]
        ans = 1
print(ans)
for i in range(N-ansnum):
    print("0")
from collections import Counter


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

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

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

sig = [0] * N

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

#print(sig)
for i in sig:
  print(i)
a = int(input())
lists = list(map(int, input().split())) #１行の入力をi[0],i[1]というように空白で分けてを取得し、iに値を入れる

num = [0]*a

def mi(x):

    
    return int(x-1)

y = list(map(mi,lists))

for i in range(a-1):
    num[y[i]] += 1
for i in range(a-1):
    print(num[i])
n=int(input())
a=[int(0)]*n
l=list(map(int,input().split()))
for i in range(n-1):
	a[l[i]] = a[l[i]] + 1
for i in range(n):
	print(a[i])
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#ans = [0]*n
n = int(input())
a = list(map(int, input().split()))
print(a)
ans = [0]*n

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

for j in ans:
    print(j)
N = int(input())

A = list(map(int, input().split(' ')))
A_set = set(A)
zeros = N - len(set(A))

for a in A_set:
  print(A.count(a))
  
print('0\n'*zeros)
N=int(input())
list=list(input().split())
ans=[]
for i in range(1,N):
  ans.append(list.count(str(i)))
print(ans)
from collections import Counter
n = int(input())
a = list(map(int,input().split()))

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

        l = []
        last = A[N-2]

        for i in range(last):
                l.append(A.count(i+1))
        for i in range(N-last):
                l.append(0)

        #[print(n) for n in l]
        for x in l:
                print(x)

if __name__=="__main__":
        main()
import numpy as np
N=int(input())
A = list(map(int, input().split()))

A_diff = np.diff(A)
#print(A_diff)

a=[0]*N
cnt=1
j=0
for i in range(len(A_diff)):
  if A_diff[i] == 0:
    cnt+=1
    continue
  else:
    a[j] += cnt
    cnt=1
    j+=1
a[j] += cnt

for ans in a:
  print(ans)
from collections import Counter
N = int(input())
counts = Counter(map(int, input().split())).values()
print(*counts, sep="\n")
print(*(0 for _ in range(N - len(counts))), sep="\n")
N=int(input())
a=list(map(int,input().split()))
for i in range(N-1):
  k=a.count(i)
  print(k)
print(0)
N = int(input())
Mgr = [int(num) for num in input().split()]

current = 1
ans = 0
for i in range(len(Mgr)):
    if(Mgr[i] != current):
        print(ans)
        ans = 1
        current = Mgr[i]
    else:
        ans += 1
        if(i == len(Mgr)-1):
            print(ans)

for j in range(i, N+1):
    print('0')
import collections
N = int(input())
A = list(map(int, input().split()))
clist = collections.Counter(A)
print(clist)
for i in range(1,N + 1):
  print(clist[i])
N=int(input())
A=list(map(int,input().split()))
dic={}
for i in range(1,N+1):
  dic[i]=0
for a in A:
  dic[a]=+1
for i in range(1,N+1):
  print(dic[i])
n=int(input())
w=list(map(int,input().split()))
a=[0]*(n)

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

for j in range(n):
    print(a)
import sys

n, *a = map(int, sys.stdin.read().split())
print(a)
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()
import numpy as np
N=int(input())
A=[int(x) for x in input().split()]

# X=np.zeros(2e5)
X=[0]*200000
for i in range(N-1):
    tmp=A[i]
    X[tmp]+=1
print(X[1:N+1])
def main():
    N = int(input())
    A = list(map(int, input().split()))

    import collections

    C = collections.Counter(A)
    for a in A:
        try:
            print(C[a+1])
        except:
            print(0)


if __name__ == '__main__':
    main()
n,*a,=map(int,open(0).read().split())
d=[0]*n
for i in a:
  d[i-1]+=1
print(*d[1:],sep="\n")
n = int(input())
a = list(map(int,input().split()))

lis = [0]*len(a)

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

print(*lis, sep='\n')
N = int(input('')) #input()で入力を受け取ってint()で数字型に変換します。

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)
#subordinate[N-1] = 0

print(subordinate)
print(A)

for index in range(N, 1, -1):
    subordinate[A[index]] = subordinate[A[index]] + 1


for index in range(1, N, 1):
    print(subordinate[index])
from collections import Counter

n = int(input())
a_count = Counter(map(lambda x: int(x), input().split()))
sorted_count = dict(sorted(a_count.items(), key=lambda x:x[0]))
for i in range(len(sorted_count)+1, n+1):
    sorted_count[i] = 0
for num in sorted_count.values():
    print(num)
N = int(input())
liste = list(map(int, input().split()))

from collections import Counter
countedList = Counter(liste)

for i in range(N):
  if i in countedList:
    print(countedList[i])
  else:
    print('0')
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))

buka_num = []

for i in range(1,N):
    tmp_A = A[i:]
    buka_num.append(tmp_A.count(i))
    
buka_num.append(0)
print(buka_num, sep='\n')
N=int(input())
X=[0]*N
for a in map(int,input().split()):
  X[a-1]+=1
for i in range(N-1):
  print(X[i])