Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import math
n,d = map(int,input().split())

y = list()
x = list()
xy = list()

for i in range(n):
    xy += map(int,input().split())

#xy_2 = int(len(xy) / 2)
#for i in range(xy_2):
#    x.append(xy.pop(0))
#    y.append(xy.pop(0))
xy2 = list()
for i in range(n):
    xy2.append(xy.pop(0)**2 + xy.pop(0)**2)
    

xy2.sort()

ans = 0
for i in range(n):
    if d >= math.sqrt(xy2[i]):
        ans += 1
    else:
        break

print(ans)



### FIXED CODE ###

n,d = map(int,input().split())
d2 = d ** 2

xy2 = list()
for i in range(n):
    x,y = map(int,input().split())
    xy2.append(x**2+y**2)

    ans = 0
for i in xy2:
    if d2 >= i:
        ans += 1
print(ans)
### BUGGY CODE ###

import itertools
import math
import numpy as np
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
import bisect
import sys
sys.setrecursionlimit(10**9)

def main():
    S = [int(s) for s in input()]
    N = len(S)
    K = 2019

    V = [0] * (N+1)
    for i in reversed(range(N)):
        rev_i = (N-1)-i
        V[rev_i+1] = V[rev_i] + S[i] * (10**(rev_i+1))
        # print(V)

    dic = {} # value:count
    U = []
    for v in V:
        u = v % K
        if u in dic:
            dic[u] += 1
        else:
            dic[u] = 1
            U.append(u)

    ans = 0
    for u in U:
        u_count = dic[u]
        ans += u_count * (u_count-1) // 2

    # print(S)
    # print(V)
    # print(dic)
    print(ans)

if __name__ == "__main__":
  main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def main():
    S = [int(s) for s in input()]
    N = len(S)
    K = 2019

    V = [0] * (N+1)
    for i in reversed(range(N)):
        rev_i = (N-1)-i
        V[rev_i+1] = V[rev_i] + S[i] * (pow(10,rev_i+1,K))
        # print(V)

    dic = {} # value:count
    U = set()
    for v in V:
        u = v % K
        if u in U:
            dic[u] += 1
        else:
            dic[u] = 1
            U.add(u)

    ans = 0
    for u in U:
        u_count = dic[u]
        ans += u_count * (u_count-1) // 2

    # print(S)
    # print(V)
    # print(dic)
    print(ans)

if __name__ == "__main__":
  main()
### BUGGY CODE ###

n,k=map(int,input().split())

a=input().split()

l=len(a)

for i in range(0,l):
    a[i]=int(a[i])

p=1
h=[]
go=0
i=0
while(go==0):
    i+=1
    
    

    h.append(p)
    p=a[p-1]
    if i==k:
        break
    if p in h:
        l=len(h)
        for j in range(0,l):
            if h[j]==p:
                amari=(k-i-1)%(i-j)
                go=1

if go==1:
    for i in range(0,amari+1):
        p=a[p-1]

print(p)


### FIXED CODE ###

n,k=map(int,input().split())


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

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

go=0


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

    ar[p]=i-1
    p=a[p-1]
    
    if ar[p]>0:
        j=ar[p]
        amari=(k-i)%(i-j)
        
        go=1
        break

if go==1:
    p=ar.index(j+amari)
    
    


print(p)
### BUGGY CODE ###

from copy import deepcopy
n,m = (int(i) for i in input().split())
p = [int(i) for i in input().split()]
x = [[int(i) for i in input().split()] for i in range(m)]
c,d,e = [[] for i in range(n+1)],[True for i in range(n+1)],[]
d[0],ans = False,0
for i,j in x:
	c[i].append(j)
	c[j].append(i)
while sum(d)!=0:
	for i in range(n+1):
		if d[i]: break
	num2 = set([i])
	while True:
		num3 = deepcopy(num2)
		for i2 in list(num2):
			for j in c[i2]: num3.add(j)
		if num2==num3: break
		else: num2 = num3
	for i in num2: d[i]=False
	e.append(list(num2))
for i in e:
	for j in i:
		if p[j-1] in i: ans+=1
print(ans)

### FIXED CODE ###

n,m = (int(i) for i in input().split())
par,rank = [i for i in range(n+1)],[0 for i in range(n+1)]
def root(x):
	if par[x]!=x: par[x] = root(par[x])
	return par[x]
def unite(x,y):
	x2,y2 = root(x),root(y)
	if x2!=y2:
		if rank[x2]<rank[y2]: par[x2] = y2
		else: par[y2] = x2
		if rank[x2]==rank[y2]: rank[x2]+=1
p = [int(i) for i in input().split()]
x = [[int(i) for i in input().split()] for i in range(m)]
for i,j in x: unite(i,j)
ans = -1
for i,j in enumerate([0]+p):
	if root(i)==root(j): ans += 1
print(ans)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(len(a)-1):
  for j in range(i + 1, len(a)):
    s += a[i]*a[j] % 1000000007
print(s % 1000000007)

### FIXED CODE ###

n = int(input())
s = 0
a = list(map(int, input().split()))
sum_tmp = sum(a[1:len(a)])
for i in range(len(a)-1):
  s += a[i] * sum_tmp
  sum_tmp -= a[i + 1]
print(s % 1000000007)
### BUGGY CODE ###

from itertools import accumulate

n = int(input())
s = input()
acc_cnt_a = [0] * (n + 1)
acc_cnt_b = [0] * (n + 1)
acc_cnt_ab = [0] * (n + 1)
cnt_a = 0
for i, c in enumerate(s):
    if c == 'D':
        acc_cnt_a[i + 1] += 1
        cnt_a += 1
    elif c == 'M':
        acc_cnt_b[i + 1] += 1
        acc_cnt_ab[i + 1] += cnt_a
acc_cnt_a = list(accumulate(acc_cnt_a))
acc_cnt_b = list(accumulate(acc_cnt_b))
acc_cnt_ab = list(accumulate(acc_cnt_ab))

q = int(input())
buf = []
for k in map(int, input().split()):
    ans = 0
    for r, c in enumerate(s):
        if c != 'C':
            continue
        r += 1
        l = max(0, r - k)
        rejected_a = acc_cnt_a[l]
        cnt_internal_b = acc_cnt_b[r] - acc_cnt_b[l]
        cnt_internal_ab = acc_cnt_ab[r] - acc_cnt_ab[l]
        ans += cnt_internal_ab - rejected_a * cnt_internal_b
    buf.append(ans)
print('\n'.join(map(str, buf)))


### FIXED CODE ###

from itertools import accumulate

n = int(input())
s = input()
acc_cnt_a = [0] * (n + 1)
acc_cnt_b = [0] * (n + 1)
acc_cnt_ab = [0] * (n + 1)
c_loc = []
cnt_a = 0
for i, c in enumerate(s):
    if c == 'D':
        acc_cnt_a[i] += 1
        cnt_a += 1
    elif c == 'M':
        acc_cnt_b[i] += 1
        acc_cnt_ab[i] += cnt_a
    elif c == 'C':
        c_loc.append(i + 1)
acc_cnt_a = [0] + list(accumulate(acc_cnt_a))
acc_cnt_b = [0] + list(accumulate(acc_cnt_b))
acc_cnt_ab = [0] + list(accumulate(acc_cnt_ab))

q = int(input())
buf = []
for k in map(int, input().split()):
    ans = 0
    for r in c_loc:
        l = r - k
        if l > 0:
            rejected_a = acc_cnt_a[l]
            cnt_internal_b = acc_cnt_b[r] - acc_cnt_b[l]
            cnt_internal_ab = acc_cnt_ab[r] - acc_cnt_ab[l]
            ans += cnt_internal_ab - rejected_a * cnt_internal_b
        else:
            ans += acc_cnt_ab[r]
    buf.append(ans)
print('\n'.join(map(str, buf)))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    h,w=map(int,input().split())
    A=[list(map(int,input().split())) for _ in range(h)]
    B=[list(map(int,input().split())) for _ in range(h)]
    dp=[[0]*w for _ in range(h)]
    x=abs(A[0][0]-B[0][0])
    dp[0][0]|=1<<x

    from itertools import product
    for i,j in product(range(h),range(w)):
        x=abs(A[i][j]-B[i][j])
        if(i-1>=0):
            for k,s in enumerate(bin(dp[i-1][j])[2:][::-1]):
                if(s=='1'):
                    dp[i][j]|=1<<(k+x)
                    dp[i][j]|=1<<(abs(k-x))
        if(j-1>=0):
            for k,s in enumerate(bin(dp[i][j-1])[2:][::-1]):
                if(s=='1'):
                    dp[i][j]|=1<<(k+x)
                    dp[i][j]|=1<<(abs(k-x))

    for k,s in enumerate(bin(dp[-1][-1])[2::][::-1]):
        if(s=='1'):
            print(k)
            return
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    h,w=map(int,input().split())
    A=[list(map(int,input().split())) for _ in range(h)]
    B=[list(map(int,input().split())) for _ in range(h)]
    dp=[[0]*w for _ in range(h)]
    x=abs(A[0][0]-B[0][0])
    offset=12800
    dp[0][0]|=1<<(x+offset)
    dp[0][0]|=1<<(-x+offset)

    from itertools import product
    for i,j in product(range(h),range(w)):
        if(i==0 and j==0): continue
        x=abs(A[i][j]-B[i][j])
        S=0
        if(i>0): S|=dp[i-1][j]
        if(j>0): S|=dp[i][j-1]
        dp[i][j]=(S<<x)|(S>>x)

    for i in range(12800):
        if((dp[-1][-1]>>(i+offset))&1):
            print(i)
            return
resolve()
### BUGGY CODE ###

from collections import deque
N, M = map(int, input().split())
edges = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)

visited = [False] * N
rooms = [-1] * N
def bfs(u):
    q = deque()
    q.append((u, -1))
    while 0 < len(q):
        (v, p) = q.popleft()
        visited[v] = True
        if p != -1 and rooms[v] == -1:
            rooms[v] = p
        for e in edges[v]:
            if visited[e]:
                continue
            q.append((e, v))

bfs(0)
print("Yes")
for x in rooms[1:]:
    print(x + 1)

### FIXED CODE ###

from collections import deque

N, M = map(int, input().split())
edges = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)

rooms = [-1] * N
def bfs(u):
    q = deque()
    q.append(u)
    while 0 < len(q):
        v = q.popleft()
        for e in edges[v]:
            if rooms[e] == -1:
                rooms[e] = v + 1
                q.append(e)

bfs(0)
print("Yes")
print(*rooms[1:], sep="\n")
### BUGGY CODE ###

N = int(input())
cities = [int(input()) for i in range(5)]

#print ("N:",N)
#print ("cities:",cities)

ans = 0

people = [N,0,0,0,0,0]
latest = 0

# maybe O(N)

while True:
	if (people[-1] == N):
		break
	else:
		for i in reversed(range(len(cities))):
			tmp = people[i]
			people[i] = max(0, people[i] - cities[i])
			people[i+1] += tmp - people[i]


	ans += 1

print (ans)


### FIXED CODE ###

N = int(input())
cities = [int(input()) for i in range(5)]

#print ("N:",N)
#print ("cities:",cities)

ans = 0

people = [N,0,0,0,0,0]
latest = 0

# maybe O(N)
'''
while True:
	if (people[-1] == N):
		break
	else:
		for i in reversed(range(len(cities))):
			tmp = people[i]
			people[i] = max(0, people[i] - cities[i])
			people[i+1] += tmp - people[i]


	ans += 1
'''

critical = (N - 1) // min(cities) 


print (5 + critical)
### BUGGY CODE ###

n = int(input())
num = input()
 
password_list = []
initial_list = []
initial_list2 = []
initial_list3 = []
 
for i in range(len(num)-2):
    if num[i] in initial_list:
        continue
    elif len(initial_list) == 10:
        break
    else:
        initial_list.append(num[i])
        for j in range(i+1,len(num)-1):
            initial_list2 = []
            if num[j] in initial_list2:
                continue
            elif len(initial_list2) == 10:
                break
            else:
                initial_list2.append(num[j])
                for k in range(j+1,len(num)):
                    initial_list3 = []
                    if num[k] in initial_list3:
                        continue
                    elif len(initial_list3) == 10:
                        break
                    else:
                        initial_list3.append(num[k])
                        target = num[i] + num[j] + num[k]
                        if target not in password_list:
                            password_list.append(target)
                else:
                    continue
                break
        else:
            continue
        break
print(len(password_list))

### FIXED CODE ###

n = int(input())
num = input()
 
password_list = []
initial_list = []
initial_list2 = []
initial_list3 = []
 
for i in range(len(num)-2):
    initial_list2 = []
    if num[i] in initial_list:
        continue
    elif len(initial_list) == 10:
        break
    else:
        initial_list.append(num[i])
        for j in range(i+1,len(num)-1):
            initial_list3 = []
            if num[j] in initial_list2:
                continue
            elif len(initial_list2) == 10:
                break
            else:
                initial_list2.append(num[j])
                for k in range(j+1,len(num)):
                    if num[k] in initial_list3:
                        continue
                    elif len(initial_list3) == 10:
                        break
                    else:
                        initial_list3.append(num[k])
                        target = num[i] + num[j] + num[k]
                        if target not in password_list:
                            password_list.append(target)
                            
print(len(password_list))
### BUGGY CODE ###

from fractions import gcd
from functools import reduce
n = int(input())
*A, = map(int, input().split())
print(max([reduce(gcd, A[:i]+A[i+1:]) for i in range(n)]))

### FIXED CODE ###

from fractions import gcd
n = int(input())
*A, = map(int, input().split())
L = [0]*n
R = [0]*n
for i in range(n-1):
    L[i] = gcd(L[i-1], A[i])
    R[n-1-i] = gcd(R[(n-i)%n], A[n-1-i])
B = [gcd(L[i-1], R[(i+1)%n]) for i in range(n)]
print(max(B))
### BUGGY CODE ###

#Problem C

N,K = map(int, input().split())
a = list(map(int,input().split()))
p = []


for i in range(N-K+1):
    p_tmp = 1
    for j in range(K):
        p_tmp *= a[i+j]
    
    p.append(p_tmp)
    
        
#print(p)
for i in range(N-K):
    if p[i+1] > p[i]:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

#Problem C

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

for i in range(N-K):
    
    if a[i] < a[i+K]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

S = input()
N = int(S.split(' ')[0])
A = int(S.split(' ')[1])
B = int(S.split(' ')[2])
#print(A+B)
 
b_count = 0
for i in range(0, N):
  #print('i')
  #print(i)
  if i % (A+B) < A:
    #print(b_count)
    b_count = b_count + 1
print(b_count)

### FIXED CODE ###

S = input()
N = int(S.split(' ')[0])
A = int(S.split(' ')[1])
B = int(S.split(' ')[2])
 
b_count = (N // (A+B)) * A
rem = N % (A+B)
b_count = b_count + min(rem, A)
print(b_count)
### BUGGY CODE ###

n=int(input())
ide_ele=n
num=2**(n-1).bit_length()
seg=[ide_ele]*2*num
segfunc=min

def init(init_val):
  for i in range(n):
    seg[i+num-1]=init_val[i]    
    for i in range(num-2,-1,-1) :
      seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
    
def update(k,x):
  k+=num-1
  seg[k]=x
  while k+1:
    k=(k-1)//2
    seg[k]=segfunc(seg[k*2+1],seg[k*2+2])
    
def query(p,q):
  if q<=p:
    return ide_ele
  p+=num-1
  q+=num-2
  res=ide_ele
  while q-p>1:
    if p&1==0:
      res=segfunc(res,seg[p])
    if q&1==1:
      res=segfunc(res,seg[q])
      q-=1
    p=p//2
    q=(q-1)//2
  if p==q:
    res=segfunc(res,seg[p])
  else:
    res=segfunc(segfunc(res,seg[p]),seg[q])
  return res
init_val=[int(i) for i in input().split()]
init(init_val)
ans=0
for i in range(n):
  for j in range(i,n):
    ans+=query(i,j+1)
print(ans)


### FIXED CODE ###

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

Ans=[0]*n
Ans[0]=1
Stack=[[A[0],1]]
for i in range(1,n):
  a=A[i]
  b,ct_b=Stack.pop()
  ct=1
  while b>a and Stack:
    ct+=ct_b
    b,ct_b=Stack.pop()
  if b<a:
    Stack.append([b,ct_b])
    Stack.append([a,ct])
  else:
    Stack.append([a,ct+ct_b])
    ct+=ct_b
  Ans[i]=ct
RA=A[::-1]
Ans_R=[0]*n
Ans_R[0]=1
Stack=[[RA[0],1]]
for i in range(1,n):
  a=RA[i]
  b,ct_b=Stack.pop()
  ct=1
  while b>a and Stack:
    ct+=ct_b
    b,ct_b=Stack.pop()
  if b<a:
    Stack.append([b,ct_b])
    Stack.append([a,ct])
  else:
    Stack.append([a,ct+ct_b])
    ct+=ct_b
  Ans_R[i]=ct  
Ans_R=Ans_R[::-1]
ans=0
for i in range(n):
  ans+=(A[i]*Ans[i]*Ans_R[i])
print(ans)
### BUGGY CODE ###

from operator import itemgetter

N,M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort()
BC = [[int(x) for x in input().split()]for _ in range(M)]
BC.sort(key = itemgetter(1),reverse=True)
x = 0
for i in BC:
    y = 0
    while(x+y<len(A) and y<i[0]):
        if(A[x+y]<i[1]):
            A[x+y]=i[1]
            y += 1
        else:
            x += 1
    x = y
print(sum(A))


### FIXED CODE ###

from operator import itemgetter
import sys
sys.setrecursionlimit(1000000)

N,M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A.sort()
BC = [[int(x) for x in input().split()]for _ in range(M)]
BC.sort(key = itemgetter(1),reverse=True)

x = 0
bc_ind = 0
ans = 0
for ind,i in enumerate(A):
    bc = 0
    if(BC[bc_ind][0]>x):
        bc = BC[bc_ind][1]
        x+=1
    else:
        bc_ind+=1
        x = 1
        if(len(BC)<=bc_ind):
            ans += sum(A[ind:])
            break
        else:
            bc = BC[bc_ind][1]
    if(bc>i):
        ans += bc
    else:
        ans += sum(A[ind:])
        break
print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())
score = {'r': P, 'p': S, 's': R}
ans = 0

for i in range(N):
    count = 0
    k = K
    while i - k >= 0 and T[i] == T[i - k]:
        count += 1
        k += K

    if count % 2 == 0:
        ans += score[T[i]]

print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())
score = {'r': P, 'p': S, 's': R}
ans = 0

for i in range(K):
    flag = True

    while i < N:
        if i >= K and T[i] == T[i-K]:
            flag = not flag
        else:
            flag = True

        if flag:
            ans += score[T[i]]

        i += K

print(ans)
### BUGGY CODE ###

a = input()
a = int(a)
sum = 0
for i in range(1,a+1):
  for j in range(1,a+1):
    for k in range(1,a+1):
      if i==1:
        sum += 1
      else:
        for b in range(i,0,-1):
          if i%b==0 and j%b==0 and k%b==0:
            sum += b
            break
print(sum)

### FIXED CODE ###

import math
K = int(input())
sum = 0
for i in range(1, K+1):
  for j in range(i, K+1):
    #2i or 3i
    if (i == j):
      for k in range(i, K+1):
        #print("i"+str(i)+"j"+str(j)+"k"+str(k))
        if ((i == j) and (i == k)):
          sum += math.gcd(i, math.gcd(j, k))
        else:
          sum += (3*math.gcd(i, math.gcd(j, k)))
    #1i
    else:
      for k in range(i+1, K+1):
        #print("i"+str(i)+"j"+str(j)+"k"+str(k))
        sum += (3*math.gcd(i, math.gcd(j, k)))
      
print(sum)
### BUGGY CODE ###

n = int(input())
numbers = list(map(int, input().split()))
c = 0

for i in range(n)[::-1]:
    for j in range(0, i)[::-1]:
        if numbers[i] <= numbers[j]:
            continue
        else:
            break
    else:
        c += 1

print(c)


### FIXED CODE ###

n = int(input())
number = list(map(int, input().split()))
cnt = 0
min_num = number[0]
for i in range(n):
  if min_num >= number[i]:
    cnt += 1
    min_num = number[i]
  else:
    continue
print(cnt)
### BUGGY CODE ###

S = input()

count = 0

for i in range(0, len(S)):

    tmp = int(S[i:i+4]) % 2019

    if tmp == 0:
        count += 1

    for j in range(i+4, len(S)):
        tmp = (tmp * 10 + int(S[j])) % 2019
        if tmp == 0:
            count += 1

print(count)

### FIXED CODE ###

from collections import Counter
import sys

# input = lambda : sys.stdin.readline().rstrip()

S = input()
n = len(S)

M = []
m = 0

for i in range(len(S)-1,-1, -1):
    
    m = (pow(10, n-i, 2019) * int(S[i]) + m) % 2019
    M.append(m)
    
    # print(S[i:n], m)

M.append(0)  # S[n:n] = "" = 0 が抜けるので、付け加える

c = Counter(M)

sum = 0
for i in c.values():
    sum += i * (i - 1) / 2

print(int(sum))
### BUGGY CODE ###

args = int(input().rstrip())

def snuke(number):
    temp = list(str(number))
    arr = [ int(t) for t in temp] 
    return sum(arr)

def find_snuke(args):
    result = []
    i = 1
    while len(result) < args:
        push = True
        for power in range(0,len(str(i))):
            if((i+10**power)/snuke(i+10**power))<(i/snuke(i)):
                push = False
                break
        if push:
            result.append(i)
        i=i+1
            
    return result

arr = find_snuke(args)
for a in arr:
    print(a)

### FIXED CODE ###

args = int(input().rstrip())

def snuke(n):
    s = 0
    while n:
        s += n % 10
        n //= 10
    return s

def find_snuke(args):
    result = []
    i = 1
    while len(result) < args:
        push = True
        p = 0
        for power in range(0,len(str(i))):
            if((i+10**power)/snuke(i+10**power))<(i/snuke(i)):
                push = False
                p = power
                break
        if push:
            result.append(i)
        i=i+10**p
            
    return result

arr = find_snuke(args)
for a in arr:
   print(a)
### BUGGY CODE ###

import itertools

n, k = map(int, input().split())
alist = sorted(list(map(int, input().split())))
paterns = list(itertools.combinations(alist, k))
divide = 10**9 + 7

ans = 0
for patern in paterns:
    gmax = patern[-1]%divide
    gmin = patern[0]%divide
    ans += (gmax - gmin)%divide


print(ans%divide)

### FIXED CODE ###

n, k = map(int, input().split())
alist = sorted(map(int, input().split()))
mod = 10**9 + 7

def comb(n, r, p=mod):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
p = mod
N = n
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

amax = 0
amin = 0
i = 0
while i <= n-k:
    cnt = comb(n-i-1, k-1)
    amax += (alist[n-i-1] * cnt)%mod
    amin += (alist[i] * cnt)%mod
    i += 1

print((amax - amin) % mod)
### BUGGY CODE ###

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

count=0


for n1 in range(10):
 for n2 in range(10):
  for n3 in range(10):
   cond=0 
   for i in range(N-2):
     if cond==1:
      break
     if n1==int(S[i]):
       for j in range(i+1,N-1):
         if cond==1:
          break
         if n2==int(S[j]):
          for k in range(j+1,N):
           if n3==int(S[k]):
             count+=1
             cond=1
             break
              
print(count)


### FIXED CODE ###

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

count=0


for n1 in range(10):
 cond=0
 for i in range(N-2):
   if n1==int(S[i]):
      p1=i
      cond=1
      break
 if cond==1:
  for n2 in range(10):
    for j in range(p1+1,N-1):
      if n2==int(S[j]):
        p2=j
        cond=2
        break
    if cond==2:
     for n3 in range(10):
       #print(n3,S[p2+1:],str(n3) in S[p2+1:] )
       if str(n3) in S[p2+1:]:
        #print(n1,n2,n3)
        count+=1
        cond=0
      
              
print(count)
### BUGGY CODE ###

n = int(raw_input())
A = map(int, raw_input().split())
q = int(raw_input())
m = map(int, raw_input().split())

def solve(i, m):
    if m == 0:
        return 1
    if i >= n:
        return 0
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res
        
for j in range(0, q):
    if solve(0, m[j]):
        print "yes"
    else:
        print "no"

### FIXED CODE ###

n = int(raw_input())
A = map(int, raw_input().split())
q = int(raw_input())
m = map(int, raw_input().split())
 
def solve(i, m):
    if m == 0:
        return 1
    if i  >= n or m > sum(A):
        return 0
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res
         
for j in range(0, q):
    if solve(0, m[j]):
        print "yes"
    else:
        print "no"
### BUGGY CODE ###

N = int(input())
sentense = input()
ans = 0
for i, s_i in enumerate(sentense):
    for j, s_j in enumerate(sentense[i+1:]):
        if s_j == s_i:
            continue
        else:
            for k, s_k in enumerate(sentense[i+j+2:]):
                if s_k == s_i or s_k == s_j:
                    continue
                else:
                    if j != k:
                        ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
sentense = input()
count_1 = sentense.count("R")*sentense.count("G")*sentense.count("B")
count_1_and_not_2 = 0
for i in range(N):
    for j in range(i+1, N):
        k = (j-i)+j
        if k >= N:
            break
        if sentense[i] != sentense[j] and sentense[j] != sentense[k] and sentense[k] != sentense[i]:
            count_1_and_not_2 += 1

print(count_1-count_1_and_not_2)
### BUGGY CODE ###

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

### FIXED CODE ###

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