peterverebics/CodeNet_Python_118 huggingface dataset:
tmp = input().split(" ")
N = int(tmp[0])
M = int(tmp[1])
tmp = input().split(" ")
A = [int(i) for i in tmp]
print(N-sum(A))
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = n
for i in a:
  ans -= i
  if ans < 0:
    print(-1)

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

hwdsum=0
k=0
while k<= m-1:
  hwdsum += a[k]
  k+=1
  
if n-hwdsum>=0:
  print(str(hwdsum))
  
else:
  print(str(-1))
N,M=map(int,input().split())
A=list(map(int,input().split()))
c=0
for i in range(M):
    c+=i
f=N-c
if f<0:
    f=-1
print(f)
N,M = map(int, input().split())
a   = list(map(int, input().split()))

ans = N
for i in range(M):
    ans -= a[i]

print(ans)
n,m=map(int,input().split())
a=list(map(int,input().split()))
print(sum(a)-n)
N, M = map(int, input().split())

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

sum_A = sum(A)

if sum_A > -1:
    print(N-sum_A)
else:
    print(-1)
import numpy as np
import math
import itertools

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

ans = N -sum(A)

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

ans = N - sum(A)

if ans > 0:
  print(ans)
else:
  print(-1)
n, m = map(int, input().split())
days = list(input().split())
for i in range(len(days)):
    n -= int(days[i])
print(n)
N,M=map(int,input().split())


m = int(M **2 * 1/2 + M *1/2)

if N > m:
    print(N-m)

else:
    print(-1)
n, m = map(int, input().split())

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

if n > a:
    print(n-a)
else:
    print(-1)
a,b=map(int,input().split())
c=list(map(int,input().split()))
print(a-sum(c))
all_days, hw_num = map(int, input().split())
hw_days = []
work = 0

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

for hw_day in hw_days:
    work += hw_day

if (all_days-work)>0:
    print(all_days-work)
else:
    print('-1')
n=int(input().split()[1])
f=n-sum(map(int,input().split()))
print(-1 if f<0 else f)
N, M = map(int, input().strip().split())
A = list(map(int, input().strip().split()))

sum = 0
for i in range(M):
    sum += A[i]

if (N - sum <= 0):
    print("-1")
else:
    print(N - sum)
N, M = map(int, input().split())
A = list(map(int, input().split()))
for Ai in A:
  N -= Ai
  if N < 0:
    print(-1)
if N >= 0:
  print(N)
import sys
N, M= map(int, input().split())
A = list(map(int, input().split()))
for j in range(M):
    if N >= 0:
        N = N - A[j]
    else:
        print(-1)
        sys.exit()
print(N)
import sys
input = sys.stdin.readline

import math

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

    print(n - sum(a_li))


if __name__ == '__main__':
    main()
N,M =input().split()
A_list=list(map(int,input().split()))
print(int(N)-sum(A_list))
M,N=map(int,input().split())


m = int(M **2 * 1/2 + M *1/2)

if N > m:
    print(N-m)

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

ans = sum(a)
if ans < lists[0]:
    print(lists[0]-ans)
else:
    print(-1)
line1 = input().split()
n = int(line1[0])
m = int(line1[1])

sum = 0
a = input().split()
for i in range(m):
  sum += int(a[i])

print(n - sum)
n,m = map(int,input().split())
A = list(map(int,input().split()))
free = n - sum(A)
if free <= 0:
  print(0)
else:
  print(int(free))
N,K=[int(s) for s in input().split()]
ls=[int(s) for s in input().split()]
print(N-sum(ls))
N,M = map(int,input().split())
A = list(map(int,input().split()))

ans = N - sum(A)
if sum(A) < N:
    print(-1)
else:
    print(ans)
def actual(n, m, a_list):
    return n - sum(a_list)


n, m = map(int, input().split())
a_list = map(int, input().split())

print(actual(n, m, a_list))
N,M = map(int,input().split())    
A = list(map(int, input().split())) 
S = 0
for i in range(M):
  S += A[i]
print (N-S)
import sys
import math
input = sys.stdin.readline
n, m = map(int, input().split())
A = [int(i) for i in input().split()]
del A[m:len(A)]
print(n - sum(A)) if sum(A) < n else print(-1)
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
asoberuhi = N - sum(A)
if asoberuhi < 0:
    print(asoberuhi)
else:
    print(-1)
n,m=map(int,input().split())
A=list(map(int,input().split()))
for i in range(m):
  n-=A[i]
  if n<0:
    print(-1)
    break

print(n)
n,m=map(int,input().split())
a=list(map(int,input().split()))
sums=0
for i in range(m):
    sums=sums+a[i]
print(n-sums)
N, M = map(int, input().split())
A = map(int, input().split())

B = sum(A)

if M < B:
  print(N-B)

else:
  print(-1)
N,M = map(int, input().split())
A = list(map(int, input().split()))
sum = 0

for i in range(M):
    sum += A[i]

print(sum)
ans = N - sum
if(ans >= 0):
    print(ans)
else:
    print(-1)
#import numpy as np
#import math
#from decimal import *
#from numba import njit

#@njit
def main():
    N,M = map(int, input().split())
    A = list(map(int, input().split()))
    s = sum(A)
    if s >= N:
        print(-1)
    else:
        print(N-s)

main()
N, M = map(int, input().split())
A = sum(list(map(int, input().split())))
if A >= M:
    print(A-M)
else:
    print(-1)
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
hw = sum(A)
print(N-hw)
n,m = map(int,input().split())
list1 = list(map(int,input().split()))
if(n>sum(list1)):
  print(n-sum(list1))
else:
  print(-1)
n,m = list(map(int,input().split()))
A = list(map(int,input().split()))
for a in A:
  n -= a

print(max(0,n))
n,m=[int(x) for x in input().split()]
li=list(map(int,input().split()))
s=sum(li)
if s<n:
  print("-1")
elif s==n:
  print(0)
else:
  print(n-s)
s = [input() for i in range(2)] 
li1 = list(map(int, s[0].split()))
li2 = list(map(int, s[1].split()))
k=0;
for j in li2:
    k+=j
    print(k)
if li1[0] > k or li1[0] == k:
    print(li1[0]-k)
else:
    print('-1')
n, m = map(int, input().split())
A = list(map(int, input().split()))

k = sum(A)

print(n-k)
M,N = map(int,input().split())
A = list(map(int,input().split()))

s = sum(A)
if s > N:
    print(-1)
else:
    print(N-s)
import math

S =  list(map(int,input().split()))
N = S[0]
M = S[1]
A =  list(map(int,input().split()))
ans = N-sum(A)
if ans <= 0:
    ans = -1
    
print(ans)
n,m=map(int,input().split())
a=list(map(int,input().split()))
p=0
for i in a:
      p+=i
if(n>=p):
          print("{}",n-p)
else:
          print("{}",-1)
N, M = map(int, input().split())
A = input()
B = []
atemp = A.split()
c = 0
for i, num in enumerate(atemp):
    B.append(atemp[i])
    c += int(num)
print(N-c)
n, m = list(map(int, input().split()))
print(max(n - sum(list(map(int, input().split()))), 0))
import math
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())
n,m = mi()
a = li()
if (sum(a) - n < 0):
    print("-1")
else:
    print(n - sum(a))
N,M = map(int,input().split())
A = list(map(int,input().split()))
for i in range(M):
    N = N - A[i]
print(N)
N,M = map(int,input().split())
A = list(map(int,input().split()))

print(N-sum(A))
n, m = map(int, input().split())
a = list(map(int, input().split()))
print(n - sum(a))
N,M = map(int,input().split())
A = list(map(int, input().split()))
toA = sum(A)
print(N - toA)
#!/usr/bin/env python3
N, M = map(int, input().split())
A = list(map(int, input().split()))
print(N - sum(A))
n, m = map(int, input().split())
aa = list(map(int, input().split()))
print(min(-1,n - sum(aa)))
def main():
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    s = sum(a)
    if s<m:
        print(-1)
    else:
        print(n-s)


if __name__ == "__main__":
    main()
# N: 夏休みの日数，M: 宿題の数
N, M = list(map(int, input().split()))
# i番目の宿題にかかる日数
A = list(map(int, input().split()))

free_days = N - sum(A)

if (free_days > 0):
    print(free_days)
else :
    print(-1)
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
As = list(map(int, input().split()))
print(N - sum(As))
import math

def main():
    N, M = map(int, input().split())
    A = sum(list(map(int, input().split())))
    print(N - A)

    return 0

if __name__ == '__main__':
    main()
n,m = map(int, input().split())
a = map(int, input().split())
print(n-sum(a))
-1 if n <= (n-sum(a))  else n-sum(a)
import math

# N = int(input())
# S = int(input())

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

# l = raw_input().split()
Ms = list(map(int, input().split()))

print(N-sum(Ms))
N,M=map(int,input().split())
A=map(int,input().split())
if N>sum(A):
    print(N-sum(A))
else:
    print(-1)
a = input()
b = input()
temp = a.split()
n = int(temp[0])
m = int(temp[1])



ai = b.split()

sum = 0

for i in range(m):
    sum += int(ai[i])

temp1 = n - sum
if n <= 0:
    print(-1)
else:
    print(temp1)
# python3
# -*- coding: utf-8 -*-
import sys
import math
import bisect
from fractions import gcd
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint

INF = float('inf')

ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
lmtx = lambda h: [list(map(int, lmis())) for _ in range(h)]
sys.setrecursionlimit(1000000000)


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


# main
n, m = mis()
alist = lmis()

if n <= m:
    print('-1')
    exit(0)
else:
    print(str(n-sum(alist)))
n, k = map(int, input().split())

mod = 10 ** 9 + 7

def comb(n, k):
    res = 1
    for i in range(n - k + 1, n + 1):
        res = res * i % mod
    for i in range(1, k + 1):
        res = res * pow(i, mod - 2, mod) % mod
    return res

calc = comb(n + 1, k)
ans = 0
ans += calc

for i in range(k + 1, n + 1):
    calc *= n + 2 - i
    calc //= i
    ans += calc

if k == n + 1:
    ans = 1
    
print(ans % mod)
n,m = map(int,input().split())
a = map(int,input().split())

date = sum(a)
if n-date <= 0:
    print(-1)
else:
    print(n-date)
n, m = map(int, input().split())
lis = list(map(int, input().split()))

ans = n
for i in range(m):
    ans -= lis[i]
print(ans)
n,m=map(int,input().split())
a=list(map(int,input().split()))
print(n-sum(a))
N, M = map(int, input().split())
A = list(map(int, input().split()))

s = 0
for n in A:
	s += n
    
d = N - s

if d > 0:
  print(d)
else:
  print(-1)
n,m=map(int,input().split())
a=list(map(int,input().split()))
if sum(a)-n >= 0:
    print(sum(a)-n)
else:
    print(-1)
n,m=map(int,input().split())
A=list(map(int,input().split()))
if n>sum(A):
    
    print(n-sum(A))
else:
    print(-1)
n,m=map(int, input().split())
a=list(map(int, input().split()))

if sum(a)>=0:
    print(n-sum(a))
else:
    print(-1)
N,M = input().split()
A = list(map(int, input().split()))
print(int(N)-sum(A))
data = input().split()

n = int(data[0])
m = int(data[1])

data = input().split()

homework = [int(s) for s in data]
day = 0

for i in homework:
  day += i

ans = n - day
print(ans)
from sys import stdin
import sys
# sys.setrecursionlimit(10**8)

def nextLine(): return next(stdin)
def nextStrList(): return nextLine().split()
def nextIntList(): return [int(_) for _ in nextStrList()]

import numpy as np

def main():
	n,m=nextIntList()
	al=nextIntList()
	
	s=n-sum(al)
	print(s)
	
if __name__=="__main__":
	main()
a, b = map(int, input().split())
c = sum(map(int, input().split()))

print(max([c - a, -1]))
def main():
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    s = sum(a)
    if s<n:
        print('-1')
    else:
        print(n-s)


if __name__ == "__main__":
    main()
n = input().split()
m = input().split()
n = [int(i) for i in n]
m = [int(i) for i in m]
a = n[0]
for i in m:
  a -= i
  if a<0:
    print("-1")


print(a)
a = list(map(int,input().split()))
b = list(map(int,input().split()))
print(a[0]-sum(b))
import numpy as np
N,M=map(int ,input().split())
A=input().split()

s=0
for i in range(M):
  s+=int(A[i])

if s>=0:
  print(N-s)
else:
  print("-1")
n,m=map(int, input().split())
su=0
a=list(map(int, input().split()))
for x in range(m):
    n-=a[x]
if n<0:
    k=-1
print(n)
import numpy as np

if __name__ == "__main__":
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    ret = -1
    A_sum = sum(A)
    if not A_sum < 0:
        ret = N - A_sum
    print(int(ret))
n,m=map(int,input().split())
l=list(map(int,input().split()))
for i in l:
  n-=i
print(n)
n,m = map(int, input().split())

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

print(n-sum(a) if n-sum(a) > 0 else "-1")
n,m = map(int,input().split())
a = list(map(int,input().split()))
sum_a = sum(a)
print(n-sum_a if n-sum_a >0 else -1)
n, m = map(int, input().split())
A = [int(x) for x in input().split()]
if n-sum(A)>0:
   print(n-sum(A))
else:
    print("-1")
A, B = map(int, input().split())
l = list(map(int, input().split()))
count = 0
for a in l:
    count += a
print(A-count)
n,m= list(map(int,input().split(" ")))
arr = list(map(int,input().split(" ")))
print(sum(arr))
if(sum(arr)>n):
    print(-1)
elif(sum(arr)==n):
    print(0)
else:
    print(n-sum(arr))
n, m = (int(i) for i in input().split())
a = [int(i) for i in input().split()]
total = sum(a)
ans = n - total
if ans < 0:
    ans == -1
print(ans)
N,M=map(int,input().strip().split())
A=list(map(int,input().strip().split()))

if sum(A)>41:
    print(-1)
else:
    print(N-sum(A))
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)
N = int(input())
A = list(map(int, input().split()))

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

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

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

print(*ans)
N=int(input())
A_lis=list(map(int,input().split()))
p={i:0 for i in range(1,N+1)} 
for j in A_lis:
    p[j]+=1
 
for i in range(1,N+1):
    print(p[i])
def main():
    N = int(input())
    *a, = map(int, input().split())

    ctr = [0] * N
    for x in a:
        ctr[x - 1] += 1
    print(*ctr, sep='\n')


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
N, = map(int, input().split())
X = list(map(int, input().split()))
R = [0]*N
for x in X:
    R[x-1] += 1
for r in R:
    print(r)
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);
n = int(input())
a =list(map(int, input().split()))
l =[0] * (n+1)

for i in range(0,n-1):
    l[a[i]] +=1
    
for i in range(1,n+1):
    print(l[i])
n=int(input())
l=list(map(int,input().split()))
d=[0]*(n+1)
for i in l:
    d[i]+=1
for i in range(1,n+1):
    print(d[i])
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])
# coding: utf-8
DATA = """
5
1 1 2 2
""".split("\n")

def get_debug_line():
	for i in DATA:
		yield i

if 1:
	get_line = input
else:
	get_line = get_debug_line().__next__
	get_line()

N = int(get_line().strip())

Memo = [0] * (N+1)
for i in get_line().strip().split(" "):
    i = int(i)
    Memo[i] += 1    

for i in range(1, N+1):
    print (Memo[i])
n = int(input())
a_list = list(map(int,input().split()))
p_list = [0 for i in range(n)]
for a in a_list:
  p_list[a-1] += 1
  
for p in p_list:
  print(p)
n = int(input())
a = list(map(int,input().split()))
li = [0]*n
for i in a:
    li[i-1] += 1
print(*li, sep="\n")
n = int(input())
k =[0]*n
a = list(map(int, input().split()))

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

for i in range(len(k)):
    print(k[i])
N = int(input())
A = list(map(int,input().split()))

ans = [0]*(N+1)

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

for i in range(1,N+1):
    print(ans[i])
import sys
import numpy as np

n=int(sys.stdin.readline())
#n,k=map(int,sys.stdin.readline().split())
a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')

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

bossNums=[]

for i in range(Num):
  bossNums.append(0)


for i in range(Num-1):
  bossNums[bossNumsList[i]-1] += 1

for i in range(Num):
  print(bossNums[i])
from collections import defaultdict
def c163(n, al):

    count = defaultdict(int)

    for i in range(n-1):
        count[al[i]] += 1

    return count

def main():
    n = int(input())
    al = list(map(int, input().split()))
    dilist = c163(n, al)
    for i in range(1 , n + 1):
        try:
            print(dilist[i])
        except:
            print("0")

if __name__ == '__main__':
    main()
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    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)

if __name__ == '__main__':
    resolve()
def main():
    n = int(input())
    joushi = list(map(int,input().split()))
    lst = [0] * n
    for i,j in enumerate(joushi):
        lst[j-1] += 1

    for n in lst:
        print(n)

main()
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])
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)
N = int(input().rstrip())
d = {}
As = [int(x) for x in input().rstrip().split()]
for i in range(1, N+1):
    d[i] = 0
for n in As:
    d[n] += 1
for i in range(1, N+1):
    print(d[i])
N = int(input())
A = list(map(int, input().split()))
joushi = [0 for _ in range(N)]
for Ai in A:
    joushi[Ai-1] += 1

for ans in joushi:
    print(ans)
import bisect,collections,copy,heapq,itertools,math,operator,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
N = I()
A = LI()
count = collections.Counter(A)
for i in range(N):
    print(count[i+1])
from collections import Counter

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

counter = Counter(a)

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

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

for i in range(1,n+1):
    print(d[i])
N = int(input())
list_A = list(map(int,input().split()))
B = [0]*N

for a in list_A:
    B[a-1] += 1

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

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

Res = [0] * (N)

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

for res in Res:
    print(res)
if __name__ == '__main__':
	N = int(input())
	countlist = [0] * N
	queri = [int(a) for a in input().split()]
	for q in queri:
		countlist[q-1] += 1
	for v in countlist:
		print(v)
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
leng = 0
count = 0
for ai in a:
    ans[ai-1] += 1

for i in ans:
    print(i)
import collections
N = int(input())
# 社員番号1以外のN-1人分担当上司番号を入力する
A = list(map(int, input().split()))
# 出現回数を数えてくれる
count = collections.Counter(A)
for n in range(N):
#   数が足りないから+1する。
  print(count[n+1])
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])
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])
import collections

N = int(input())
A_list = list(map(int, input().split()))
A_collection = collections.Counter(A_list)

for i in range(N):
    print(A_collection[i+1])
n = int(input())
A = list(map(int,input().split()))
sya = [0]*n
for a in A:
    sya[a-1]+=1
for i in range(n):
    print(sya[i])
from collections import Counter

n = int(input())
an = list(map(int, input().split(' ')))

c = Counter()
for a in an:
    c[a] += 1

for i in range(1, n + 1):
    print(c[i])
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.keys():
        print(C[i])
    else:
        print(0)
n = int(input())
b = [0] * n
a = list(map(int, input().split()))

for i in a:
    b[i-1] += 1
for i in b:
    print(i)
from typing import List, Dict


def main(N: int, A: List[int]):
    bosses: Dict[int, List[int]] = {}

    for i, boss in enumerate(A, start=2):
        if boss not in bosses:
            bosses[boss] = [i]
        else:
            bosses[boss].append(i)

    for worker in range(1, N + 1):
        if worker not in bosses:
            print(0)
        else:
            print(len(bosses[worker]))


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

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

import collections
c = collections.Counter(A)

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

A = [-1] + [int(x) - 1 for x in input().split(" ")]

resses = [0] * n

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

for res in resses:
    print(res)
N = int(input())
A = [0]
A += list(map(int, input().split()))
B = [0] * N
for i in range(1,N):
    B[A[i]-1] += 1
for j in range(N):
    print(B[j])
N = int(input())
A = list(map(lambda x:int(x), input().split(" ")))
R = [0 for i in range(N)]

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

for r in R:
    print(r)
import collections

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

ac = collections.Counter(a)
for i in range(1,n+1):
    print(ac[i])
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
C = [0 for i in range(N)]
A.sort()
i = 0
while i < N - 1:
    C[A[i] - 1] = C[A[i] - 1] + 1
    i += 1

for i in C:
    print(i)
n = int(input())
a = list(map(int,input().split()))

emp = [0]*(n+1)

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

for i in range(1,n+1):
    print(emp[i])
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n=int(input())
count=[0]*n
a=list(map(int,stdin.readline().split()))
for i in a:
    count[i-1]+=1
for i in count:
    print(i)
num_sub  = int(input())
sub_boss = input().split()

num_boss = [0]*(num_sub)

for i in sub_boss:
	i = int(i)
	num_boss[i-1] = num_boss[i-1] + 1

for i in num_boss:
  print(i)
N = int(input())
A = list(map(int, input().split()))

lis = [0]*N
for a in A:
    lis[a-1] += 1
for num in lis:
    print(num)
n = int(input())
a = [ai for ai in map(int, input().split())]
res = dict((i, 0) for i in range(n))
for ai in a:
    res[ai-1] += 1
for i in res.values():
    print(i)
n=int(input())
a=[0]+list(map(int,input().split()))
b=[0 for i in range(n+1)]

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

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

l = [0] * n

for i in range(n-1):
    l[A[i]-1] += 1
for i in range(n):
    print(l[i])
n = int(input())

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

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