peterverebics/CodeNet_Python_118 huggingface dataset:
import collections

n = int(input())

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

c = collections.Counter(l)

print(c[1])
for i,value in enumerate(l):
  print(c[i+2])
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])
n = int(input())
data = list(map(int, input().split()))

count = [0] * n

for d in data:
  count[d-1] += 1

for c in count:
  print(c)
n = int(input())
a = list(map(int,input().split()));
b = [0]*n

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

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

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

memo = [0]*n

for i in t:
    memo[i-1] += 1

for j in memo:
    print(j)
N = int(input())
boss = {i+1: 0 for i in range(N)}
A = map(int, input().split())

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

for i in range(N):
    print(boss[i+1])
d = {}
n = int(input())
a = [int(i) for i in input().split()]

for i in range(1,n+1):
  if i not in d:
    d[i] = 0

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

for i in d:
  print(d[i])
import numpy as np
N = int(input())
A = list(map(int,input().split()))
output_ = np.zeros(N)
for A_ in A:
    output_[A_ - 1] += 1
for o_ in output_:
    print(int(o_))
import sys
from operator import itemgetter
import collections
import math

def r(n, a):
    d = [0] * n
    for aa in a:
        d[aa-1] = d[aa-1] + 1
    for nn in range(n):
        print(d[nn])


def main():
    input = sys.stdin.readline
    n = int(input())
    a = list(map(int, input().split()))
    r(n, a)

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

menber = [0]*n

for value in a:
    menber[value-1] += 1
    
for i in menber:
    print(i)
from collections import Counter
N = int(input())
A = [int(c) for c in input().split()]
c = Counter(A)
for i in range(1,N+1):
  print(c[i])
n = int(input())
a = [int(ai) for ai in input().split(" ")]

joushi_buka = [0 for ni in range(n)]
for ai in a:
    joushi_buka[ai-1] += 1

for jb in joushi_buka:
    print(jb)
N = int(input())
A = [0, 0, *list(map(int, input().split()))]
ans = [0] * (N+1)
for a in A:
    ans[a] += 1
for a in ans[1:]:
    print(a)
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)
def resolve():
    N = int(input())
    arr = list(map(int, input().split()))
    from collections import defaultdict
    nums = defaultdict(int)
    for num in arr:
        nums[num] += 1
    for i in range(1, N+1):
        print(nums.get(i, 0))
resolve()
N = int(input())
A_i = list(map(int, input().split()))

num = [0] * N

for i in A_i:
    num[i-1] += 1

for i in num:
    print(i)
import collections
N = int(input())
t = list(map(int, input().split()))

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

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

for i in l:
    print(i)
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)
N=int(input())
import collections
b=input().split()
c = collections.Counter(b)
c=list(c.values())


for i in range(N) :
	if len(c)>i :
		print(c[i])
	else :
		print('0')
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    for i in range(N-1):
        print(A.count(i+1))
resolve()
from collections import Counter
def main():
  N=int(input())
  A=list(map(int,input().split()))
  d=Counter(A)
  for i in range(1,N+1):
    if i not in d:
      print(0)
    else:
      print(d[1])
if __name__=='__main__':
  main()
N = int(input())
A = list(map(int,input().split()))

print(A.count(i+1) for i in range(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], end = '\n')
num_all = int(input())
list = input().split(" ")
list_int = []
for i in list:
  list_int.append(int(i)) 
print(list_int)

for j in range(num_all):
  a = list_int.count(j)
  print(a)
N = int(input())
A = input()
S = A.replace(' ','a')
for i in range(N):
  j = str(i+1) + 'a'
  k = S.count(j)
  print(k)
n=int(input())
a=list(map(int,input().split()))
l=[]
for i in range(1,n+1):
  if a.count(i)>0:
    print(a.count(i))
    exit()
    l.append(a.count(i))
x=n-len(l)
y='0'*x
m=list(str(y))
n='\n'.join(m)
print(n)
import collections
N = int(input())
A = input().split()
clist = collections.Counter(A)
for i in range(1,N):
  j = str(i)
  print(clist['i'])
n = int(input())
A_list = list(map(int, input().split(" ")))
print(A_list)
for i in range(1, n+1):
    print(A_list.count(i))
n = int(input())
A = list(map(int,input().split()))
A.insert(0,0)
b = []
for i in A:
    print(A.count(i+1))
N = int(input())
A=[int(i) for i in input().split()]

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

for i in B:
    print(i)
n = int(input())
dict = {}
for i in map(int, input().split(" ")):
	dict[i] = dict.get(i, 0) + 1
 
for i in range(0, n + 1):
	print(dict.get(i, 0))
n = int(input())
a = list(map(int,input().split()))
b = set(a)
c = n-len(b)
for i in b:
    if i in a:
        num = a.count(i)
        print(num)
    elif not i in a:
        print(0)

ans = '0\n'*c
print(ans)
from collections import Counter
N = int(input())
funcionarios = list(map(int,input().split()))
for x in Counter(funcionarios).values():
    print(x)
    N -= 1
a = N
while a != 0:
    print(0)
    a -= 1
N = int(input())

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

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

for ans in anslst:
  print(ans)
N = int(input())
A = list(input().split())
B = [0 for i in range(N)]
for i in range (N-1):
  for j in range (i-1,N+1):
    if int(A[i])==j:
      B[j-1]=B[j-1]+1
[print(i) for i in B]
s = [input() for i in range(2)] 
li = list(map(int, s[1].split()))
s0 = int(s[0])
f1 = 0
for i in li:
    if i == 1:
        f1 += i
for j in range(1,s0+1):
    if s0-f1*j > 0:
        print(f1)
    else:
        print(0)
N=int(input())
A = list(map(int, input().split()))
for n in range(N):
    print(A.count(str(n)))
N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N-1):
  D[i].append(A[i]-1)
for i in range(N):
  print(len(D[i]))
count = int(input())

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

total = 0
for i in range(count):
    a = data.count(i + 1)
    total += a
    print(a)
    if total == count - 1:
        print("0\n" * (count - i))
        break
from collections import Counter
n = int(input())
a = list(map(int, input().split()))

for _ in Counter(a).values():
  print(_)
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)
n = int(input())
a = list(map(int,input().split()))

for i in range(1,n):
    nmb_cnt = 0
    idx_cnt = 0
    for j in a:
        if j == i:
            del a[idx_cnt]
            nmb_cnt += 1
        else:
            idx_cnt += 1
    print(nmb_cnt)

print(0)
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-1):
    print(ans[i])
N = int(input())
b = list(map(int,input().split()))
print(b)
for i in range(N + 1):
    a = b.count(i)
    print(a)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

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

if __name__ == '__main__':
    main()
import numpy as np
import math as mt
N=int(input())
#R=map(int, input().split())
A=list(map(int,input().split()))
count=1
p_count=0
for i in range(0,N-1):
    if i==N-2:
        print(count)
        for i in range(0,N-p_count-1):
            print(0)
    elif A[i]!=A[i+1]:
        print(count)
        count=1
        p_count=p_count+1
    else:
        count=count+1
def funcx(a, i):
    cnt = 0
    for num in a:
        if num == i:
            cnt = cnt + 1
    return cnt


def func(a, i, ptr, n):
    cnt = 0
    # print("xxx", i, ptr)
    while ptr < n and a[ptr] == i:
        ptr = ptr + 1
        cnt = cnt + 1
        # print("yyy", ptr)
    return cnt, ptr


n = int(input())
a = list(map(int, input().split()))
ptr = 0
for i in range(n):
    # print(i+1)
    cnt, ptr = func(a, i + 1, ptr, n - 1)
    print(cnt)
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

l = Counter(A)

for i in range(N):
  if i in l:
    print(l[i])
  else:
    print(0)
n = int(input())
a = list(map(int, input().split()))
p = 0

for i in list(set(a)):
    ans = a.count(i)
    print(ans)
    a = [s for s in a if s != i]
    p = p + ans
    if p == n-1:
        break
for s in range (n-i):
    print(0)
import sys
from collections import Counter
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
k = set(A)
r = set(range(1, N + 1))

for key in r - k:
    c[key] = 0

for v in c.values():
    print(v)
import numpy as np

N = int(input())
D = [int(x) for x in input().split()]
D = np.array(D)
D_unique = np.unique(D)

for i in range(1, N):
    num = np.sum(D == i)
    print(num)
n = int(input())
a = input().split()

for i in range(n):
    print(a.count(i+1))
from collections import Counter
n = input()
l = input().split()
lt = [int(i) for i in l]
f = Counter(l)
for i in lt:
    print(f[str(i+1)])
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    count = 0
    B =[]
    for j in range(len(A)):
        if A[j]==i:
            count += 1
        else:
            B.append(A[j])
    print(count)
    print(B)
    A = B
n = int(input())

a_list = list(map(int, input().split()))
buka_list = []

one_a = ''.join([str(n) for n in a_list])

one_a = str(one_a)

print(one_a)

for i in range(1, n + 1):

    # print('iは')
    # print(i)

    print(one_a.count(str(i)))

    # buka_list.append(one_a.count('i'))
size = int(input())
li = list(map(int,input().split()))
ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)
N = int(input())
s = input().split(" ")
A = []
d = {}
for w in s:
    A.append(int(w))
    if w in d.keys():
        d[w] += 1
    else:
        d[w] = 1

for n in range(N):
    if str(n + 1) in d.keys():
        print(d[w])
    else:
        print(0)
n = int(input())
A =[int(x) for x in input().split()]
ans = [0] * n
for i in range(n-1):
    ans[A[i]-1] +=1

for i in ans:
    print(ans[i])
N = int(input())
arr = list(map(int, input().split()))
ans = [0]*N

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

print(ans)
N = int(input())

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

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

boss_list = sorted(boss_list)


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

    if i == 0:
        boss_num -= 1

    print(boss_num)
N = int(input())
A = list(map(int, input().split()))
for r in {A.count(i) for i in range(1, N + 1)}:
    print(r)
n = int(input())
lst = list(map(int, input().split()))

for i in range(2, n+1):
  print(lst.count(i))
N=int(input())
a = list(map(int, input().split()))
print(a.count(1))
for i in range(1,N):
    n=a.count(i)
    m=a.count(i+1)
    for x in range(0,n):
        print(m)
    if m==0:
        break
import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

N = int(readline().rstrip()) 
A = list(map(int,readline().rstrip().split()))

buka=[0]*N

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

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

A1 = set(A)
A1 = list(A1)
list(A1).sort()

for i in A1:
    print(A.count(i))

for i in range(N-len(A1)):
    print(0)
N=int(input())
Boss=list(map(int, input().split()))
Boss.insert(0, 0)
for i in range(N):
    print(Boss.count(Boss[i]+1))
N=int(input())
A=list(map(int,input().split()))
for i in range(N-1):
  b=A.count(i+1)
  print(b)
n = int(input())
a = [x for x in input().split()]

count = []
temp = a[0]
for i in range(1, len(a)):
    if a[i] == a[i-1]:
        temp += a[i]
    else:
        count.append(temp)
        temp = a[i]

count.append(temp)

for x in count:
    print(len(x))

rest = len(a) - len(count)
for x in range(rest+1):
    print(0)
'''بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ'''
#codeforces
from collections import Counter
gi = lambda : list(map(int,input().split()))
n, = gi()
occ = Counter(gi())
for k in range(1, n + 1):
	if k not in occ:
		occ[k] = 0
for k in occ:
	print(occ[k])
s = input().split()
n = int(s[0])
s = input().split()
d = [0]*n
print(d)
for i in s:
    d[int(i)-1]+=1

for i in range(n):
    print(d[i])
import collections
n=int(input())
a=list(map(int,input().split()))

b=collections.Counter(a)
for i in range(n+1):
    print(b[i])
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)
from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
a_ = [int(x) for x in range(1, n+1)]
a += a_
a_count = Counter(a)
for i in a_count:
    print(str(a_count[i]-1))
from collections import Counter

n=int(input())
a=list(map(str,input().split()))
b=Counter(a)
b=list(b.values())

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

for i in range(n-len(b)):
    print(0)
N = int(input())
values = list(map(int, input().split()))
values_dict = {}

for value in values:
    values_dict[value] = values_dict.get(value, 0) + 1

print(values_dict.get(i, 0) for i in range(1, N+1))
N = int(input())
X = [0]*N
A = list(map(int,input().split()))
for i in A:
    X[i] +=1
print(*X,sep="\n")
n = int(input())
a = list(map(int,input().split()))

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

i = int(1)
for i in a:
    if i > n:
        break
    else:
        print(a.count(i))
N = input()
S = input()

for A in range (int(N)-1):
    print(S.count(str(A+1),A,int(N)-2))
def main():
  n = int(input())
  A = list(map(int, input().split()))
  
  num = [0] * n
  
  for i in range(0, n-1):
    for k in range(0, len(A)):
      if A[k] == i+1:
        num[i] += 1
      
  print(num)
  
main()
N=int(input())
A=list(map(int,input().split()))
A.insert(0,0)
B=[]

for i in range(len(A)):
    cnt=0
    for j in range(len(A)):
        if A[i]-A[j]==-1:
            cnt+=1
            continue
    B.append(cnt)

print(B)
def main():
    n = int(input())
    a = list(map(int, input().split(' ')))
    buka = [0]*n
    print(a)

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

    for i in buka:
        print(i)


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

for i in range(len(b)):
    print(b.count(b[i]))
print(0)
from collections import Counter
 
n = int(input())
a = list(map(int, input().split()))
 
c = Counter(a)
 
for _ in range(1, n):
  print(c[_])
n=int(input())
a=[int(x) for x in input().split()]
for c in range(n-1):
    s=0
    for d in range(c,n-1):
        if a[d]==c+1:
            s+=1
    print(s)
N = int(input())
A = list(map(int,input().split()))
for i in range(1, N):
   print(A.count(i))
n=int(input())
li=[int(x) for x in input().split()]
d={}
for i in range(len(li)):
	if li[i] in d:
		d[li[i]]+=1
	else:
		d[li[i]]=1
c=0
for u,v in d.items():
	print(v)
	c+=1

while c<n:
	print(0)
	c+=1
#--management

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

ans = []

ans = [0] * member
print(ans)

for j in range(1,member):
  k = mem_number.count(j)
  ans[j-1] = k

for i in  range(member):
  print(ans[i])
from collections import deque as dq

n = int(input())
a = dq(int(i) for i in input().split())
l = [0] * (n - 1)

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

for i in l:
    print(i)
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in jousi :
    i = i-1
    a[jousi[i] -1] += 1
for i in range(len(a)):
    print(int(a[i]))
num = int(input())
l_a = input().split()
s_a = set(l_a)

dc = {}

l_s = []
for i in s_a:
  dc[i] = l_a.count(i)
  
index = 1
k = 0
l_key = sorted(dc.keys())

for i in l_key:
  while int(i) + k < index:
    print(0)
    k += 1
  print(dc[i])
  index += 1
  
while index <= num:
  print(0)
  index += 1
import collections
n=int(input())
a=list(map(int,input().split()))
b=list(collections.Counter(a).values())
for i in b:
  print(i)
import collections

n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
CountList = list(Col) 
for i in range(n-len(CountList)):
    CountList.append(0)

for i in CountList:
    print(i)
n = int(input())
L = list(map(int,input().split()))
M = [0]*n
for i in range(n-1):
    M[L[i]-1] +=1
print(M)
from collections import Counter
N = int(input())
l = list(map(int, input().split()))
counter = Counter(l)
for i in counter.values():
    print(i)
for i in range(N-len(counter)):
    print(0)
n = int(input())
boss_list = list(map(int, input().split(" ")))

boss_list = sorted(boss_list)


for i in range(1, n+1):
    if len(boss_list) > 0:
        try:
            boss_count = boss_list.index(i + 1)
        except:
            if i in boss_list:
                boss_count = boss_list.count(i)
    else:
        boss_count = 0
    del boss_list[:boss_count]
    print(boss_count)
N = int(input())
import collections

b = input().split()
c = collections.Counter(b)
d = list(c.values())
e = list(c.keys())

current = 0
for i in range(N):
    if len(c) > current:
        if e[current] == str(i + 1):
            print(d[current])
            
            current += 1
        else:
            print('0')
            
    else:
        print('0')
import numpy as np
 
def calculate_num_boss(num_person, boss):
    boss_count = np.zeros([num_person])
    result, num = np.unique(boss, return_counts=True)
    for idx in range(result.shape[0]):
        ids = result[idx]
        boss_count[ids-1] = num[idx]
 
    return boss_count
 
 
if __name__ == "__main__":
    num_person = int(input().split()[0])
    bosses = np.array([int(i) for i in input().split()])
n = int(input())
s = list(map(int, input().split()))
t = []
cnt = 2
for a in s:
  try:
    t[a-1].append(cnt)
  except IndexError:
    for _ in range(a-len(t)):
      t.append([])
      t[-1].append(cnt)
for i in range(len(t)):
  print(len(t[i]))
for _ in range(n-len(t)):
  print(0)
import collections
N = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)
print(c)

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

line = list(map(int, input().strip().split(" ")))

ans = [0 for s in range(n)]

for i in line:
    ans[i] += 1

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

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

total = 0

for i in range(count):
    a =data.count(i + 1)
    print(a)
    if total + a+1 == count:
        print("0 \n" *(count - i))
n = int(input())
jyoushis = list(map(int, input().split()))

nums = 1
cnt = 0
top = 1
for jyoushi in jyoushis:
  if top == jyoushi:
    cnt+=1
  else:
    print(cnt)
    top = jyoushi
    cnt = 1
    nums+=1
print(cnt)
if nums < n:
  sabun = n - nums
  for i in range(sabun):
    print(0)
n = int(input())

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

import collections
c = collections.Counter(a)

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

for i in range(1, n):
    print(a.count(i))
N = int(input())
numbers = input().strip().split(' ')

boss_dict = [0] * N
for i in range(N - 1):
    boss_num = int(numbers[i])
    boss_dict[boss_num] += 1
    
for boss in boss_dict:
    print(boss)
n= int(input())

list1= input().split()
list2=list(set(list1))
for i in range(n):
	if i+1 in list2:
		a=list.count(i+1)
		cnt+=a
		print(a)
	else:
		print(0)
N = int(input())
emp = list(map(int,input().split()))
emp.sort()
def rem_val(arr, value):
    while value in arr:
        try:
            arr.remove(value)
        except:
            break
for i in range(N):
    if(len(emp)!=0):
        print(emp.count(i+1))
        rem_val(emp,i+1)
    print(0)
n=int(input())
p=list(map(int,input().split()))
li=[]
for i in range(1,n):
    q=p.count(i)
    li.append(q)
for result in li:
    print(result,"\n")
import bisect
N = int(input())
A = [int(x) for x in input().split()]
index = 0
for i in range(1, N+1):
    now = bisect.bisect_right(A, i)
    print(now - index)
    index = now
N = int(input())
now = 1
sum = 0
for i in sorted(list(map(int,input().split()))):
    if(now == i):
        sum += 1
    else:
        for j in range(i - now -1):
            print(0)
        print(sum)
        sum = 1
        now = i
else:
    print(sum)
while(now < N):
    print(0)
    now += 1
N = int(input())
A = list(map(int,input().split()))
tmp2 = 0
for i in range(N+1):
  if(i == 0):
    tmp=A.count(1)
    print(str(tmp))
  else:
    tmp2 = i + 1
    tmp=A.count(tmp2)
    print(str(tmp))
in1 = int(input())
A = list(map(int, input().split()))
for i in range(1, in1):
    print(A.count(i))
N = int(input())
A = list(map(int,input().split()))
A_max = max(A)
for i in range(1,A_max+1):
  if A_max < i:
    print(0)
  else:
    print(A.count(i))
n = int(input())
lst = list(map(int,input().split()))
ans = [0] * n

for i in lst:
    ans[i] += 1
ans.remove(0)
ans.append(0)
print(ans)
n = int(input())
a = list(map(int, input().split()))
a.sort()
cnt = 0
p_cnt = 0
for i in range(1,n-1):
  if a[i-1] == a[i]:
    cnt += 1
  else:
    print(cnt+1)
    p_cnt +=1
    cnt = 0
print(cnt+1)
p_cnt +=1
for i in range(n -p_cnt):
  print(0)
N = int(input())
A = list(map(int, input().split()))

man=1
cnt=0
man_list=[0]*N
A += [0]

for a in A:
  if a != man:
    man_list[man-1] = cnt
    man = a
    cnt=0
  cnt+=1

for l in man_list:
  print(l)
N = int(input())

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

for i in range(N-1):
    print(A.count(i+1))
import collections

n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
CountList = list(Col.values()) 
for i in range(n-len(CountList)):
    CountList.append(0)

for i in CountList:
    print(i)
n=int(input())
l=list(map(int,input().split(" ")))
r=[0]*n
for i in range(len(l)):
    r[l.pop()]+=1
    
for i in range(n-1):
    print(r[i+1])
N = int(input())
A = list(map(int,input().split()))
print(N,A)
n =  [0 for i in range(N) ]
print(n)
for i in A:
    n[i - 1] += 1

for j in n:
    print(j)
import numpy as np
n = input()
n = int(n)
array_1 = list(map(int, input().strip().split()))
ans_list=[]
 
for i in range(n):
  ans_list.append(array_1.count(i+1))
  
print(ans_list)
n = int(input())
li = [int(x) for x in input().split()]
count = 0
for x in li:
  print(li.count(x))
  count += 1
for i in range(n-count):
  print(0)
N=int(input())
A=list(map(int,input().split()))
s=[]
for i in range(N-1):
  b=A.count(i+1)
  s.append(b)
  s.append("\n")
print(s)
def main():
    N = int(input())
    A = list(map(int, input().split()))

    import collections

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


if __name__ == '__main__':
    main()
N=int(input())
A=list(map(int,input().split()))
A.insert(0,0)
B=[]

for i in range(len(A)):
    cnt=0
    for j in range(len(A)):
        if A[i]-A[j]==-1:
            cnt+=1
            continue
    print(cnt)
n = int(input())
arr = {}
s = list(map(int, input().split()))
for i in range(1, n):
  arr[i] = arr.get(s[i-1], 0) + 1

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