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

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

def primes_for(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n + 1):
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

ans = 0
lim = 10**6+1
ok = [True]*lim

for a in sorted(A):
    for j in range(a*2, lim, a):
        ok[j] = False

cnt = Counter(A)
for a in A:
    if cnt[a] == 1 and ok[a]:
        ans += 1
print(ans)


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

ans = 0
lim = max(A)+1
ok = [True]*lim
checked = [False]*lim

for a in sorted(A):
    if (not checked[a]) and ok[a]:
        checked[a] = True
        for j in range(a*2, lim, a):
            ok[j] = False

cnt = Counter(A)
for a in A:
    if cnt[a] == 1 and ok[a]:
        ans += 1
print(ans)
### BUGGY CODE ###

import sys
import time
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

import functools
@functools.lru_cache(maxsize=None)
def factrial_memo(n):
  fact = [1, 1]
  for i in range(2, n + 1):
    fact.append((fact[-1] * i) % mod)
  return fact

def permutation(n,r): #nPr
  return fact[n]*pow(fact[n-r],mod-2,mod)%mod
  
def combination(n,r): #nCr
  return permutation(n,r)*pow(fact[r],mod-2,mod)%mod

def homogeneous(n,r): #nHr
  return combination(n+r-1,r)%mod

def tami(n, r):
  if r == 0:
    res = fact[n]
    return res %mod
  elif r == 1:
    res = fact[n-1] * (n-1)
    return res %mod
  else:
    return tami(n-1, r-1) + tami(n-1, r-2)

N,M = IL()

fact = factrial_memo(10**6)

ans = 0
for i in range(max(0, 2*N-M), N+1):
  ans += combination(N,i) * combination(M-N, N-i) * tami(N, i) %mod
print(((combination(M, N) * fact[N] )%mod * ans) %mod)

### FIXED CODE ###

import sys
import time
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

import functools
@functools.lru_cache(maxsize=None)
def factrial_memo(n):
  fact = [1, 1]
  for i in range(2, n + 1):
    fact.append((fact[-1] * i) % mod)
  return fact

def permutation(n,r): #nPr
  return fact[n]*pow(fact[n-r],mod-2,mod)%mod
  
def combination(n,r): #nCr
  return permutation(n,r)*pow(fact[r],mod-2,mod)%mod

def homogeneous(n,r): #nHr
  return combination(n+r-1,r)%mod

N,M = IL()

fact = factrial_memo(10**6)

s = 0
for k in range(1,N+1):
  s += combination(N, k) * permutation(M-k, N-k) * (-1)**(k-1)
ans = (permutation(M, N)**2 - s*permutation(M, N)) %mod
print(ans)
### BUGGY CODE ###

def match(c1, c2):
    return c1 == '?' or c1 == c2 or '?' == c2

a = input()
b = input()
c = input()
A, B, C = len(a), len(b), len(c)
ab, bc, ca = [1] * 20000, [1] * 20000, [1] * 20000

for i in range(A):
    for j in range(B):
        if not match(a[i], b[j]):
            ab[i-j+10000]= 0
for i in range(B):
    for j in range(C):
        if not match(b[i], c[j]):
            bc[i-j+10000]= 0
for i in range(C):
    for j in range(A):
        if not match(c[i], a[j]):
            ca[i-j+10000]= 0
ans = 6000

for i in range(-4000, 4000):
    for j in range(-4000, 4000):
        if ab[i+10000] and bc[j-i+10000] and ca[-j+10000]:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R-L)
print(ans)
    

### FIXED CODE ###

a = input()
b = input()
c = input()
A, B, C = len(a), len(b), len(c)
ab, bc, ac = [1] * 16000, [1] * 16000, [1] * 16000

for i in range(A):
    if a[i] == '?':
        continue
    for j in range(B):
        if b[j] != '?' and a[i] != b[j]:
            ab[i-j+8000]= 0
for i in range(B):
    if b[i] == '?':
        continue
    for j in range(C):
        if c[j] != '?' and b[i] != c[j]:
            bc[i-j+8000]= 0
for i in range(A):
    if a[i] == '?':
        continue
    for j in range(C):
        if c[j] != '?' and a[i] != c[j]:
            ac[i-j+8000]= 0
ans = 6000

for i in range(-4000, 4000):
    for j in range(-4000, 4000):
        if ab[i+8000] and bc[j-i+8000] and ac[j+8000]:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R-L)
print(ans)
### BUGGY CODE ###

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

N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
l = [0] * N
ans = 0
count = 0
check = [False] * N
tmpl = []

while(count < N):
    check = [False] * N
    for i in range(N):
        if l[i] < N - 1:
            to = A[i][l[i]] - 1
            if (not check[to]) and (not check[i]):
                if A[to][l[to]] - 1 == i:
                    l[i] += 1
                    l[to] += 1
                    check[to] = True
                    check[i] = True
                if l[i] == N - 1:
                    count += 1
                if l[to] == N - 1:
                    count += 1
    ans += 1
    if tmpl == l:
        print(-1)
        exit()
    tmpl = l[:]
    # print(l, ans)

print(ans)


### FIXED CODE ###

import sys
import time
def input():
    return sys.stdin.readline()
 
def main():
    a = time.time()
    N = int(input())
    A = [list(map(int, input().split())) for _ in range(N)]
    l = [0] * N
    ans = 0
    count = 0
    check = [False] * N
    tmpl = []
    next = False
 
    while(count < N):
        check = [False] * N
        for i in range(N):
            if l[i] < N - 1:
                to = A[i][l[i]] - 1
                if (not check[to]) and (not check[i]):
                    if A[to][l[to]] - 1 == i:
                        l[i] += 1
                        l[to] += 1
                        check[to] = True
                        check[i] = True
                        next = True
                    if l[i] == N - 1:
                        count += 1
                    if l[to] == N - 1:
                        count += 1
        ans += 1
        if not next:
            print(-1)
            exit()
        next = False

        b = time.time()
        if b - a >= 1.7:
            print(N*(N - 1)//2)
            exit()
        # print(l, ans)
 
    print(ans)
 
if __name__ == '__main__':
    main()
### BUGGY CODE ###

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

arr = []
for i in range(n):
	arr += [int(input())]
	
arr2 = sorted(arr)

ans = float('inf')

for i in range(n-k+1):
	mx = max(arr2[i:i+k])
	mn = min(arr2[i:i+k])
	ans = min(ans,mx-mn)

print(ans)


### FIXED CODE ###

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

arr = []
for i in range(n):
	arr += [int(input())]
	
arr2 = sorted(arr)

ans = float('inf')

for y in range(n-k+1):
	mx = arr2[y+k-1]
	mn = arr2[y]
	ans = min(ans,mx-mn)

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

import copy
a = int(input())
da = list(map(int,input().split()))
k = a//2
for i in range(a):
  n = copy.deepcopy(da)
  del n[i]
  list.sort(n)
  print(n[k-1])

### FIXED CODE ###

n = int(input())
aa = list(map(int,input().split()))
a = [[] for i in range(n)]
for i in range(n):
    a[i].append(aa[i])
    a[i].append(i)

a.sort()

mm = a[n//2-1][0]
m = a[n//2][0]
for i in range(n):
    a[i].append(i)
a.sort(key = lambda x:x[1])

for i in range(n):
    if a[i][2] <= n//2 -1:
        print(m) 
    else:
        print(mm)
### BUGGY CODE ###

k,s=map(int,input().split())
print(sum(x+y+z==s for x in range(k+1) for y in range(k+1) for z in range(k+1)))

### FIXED CODE ###

k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        if s-i-j<0: break
        if s-i-j<=k: ans+=1
print(ans)
### BUGGY CODE ###

N = int(input())
S = input()
count = 0
def findb(ind,checker):
    global count
    b = S[ind:].count("B")
    if b > 0:
        if ind + checker < N:
            if S[ind+checker] == "B":
                b -= 1
        count += b
def findg(ind,checker):
    global count
    g = S[ind:].count("G")
    if g > 0:
        if ind + checker < N:
            if S[ind+checker] == "G":
                g -= 1
        count += g
def findr(ind,checker):
    global count
    r = S[ind:].count("R")
    if r > 0:
        if ind + checker < N:
            if S[ind+checker] == "R":
                r -= 1
        count += r
for i in range(N-2):
    st = S[i:]
    if st[0] == "R":
        for j in [x for x, y in enumerate(st) if y == 'G']:
            findb(i+j,j)
        for j in [x for x, y in enumerate(st) if y == 'B']:
            findg(i+j,j)
    elif st[0] == "G":
        for j in [x for x, y in enumerate(st) if y == 'B']:
            findr(i+j,j)
        for j in [x for x, y in enumerate(st) if y == 'R']:
            findb(i+j,j)
    else:
        for j in [x for x, y in enumerate(st) if y == 'R']:
            findg(i+j,j)
        for j in [x for x, y in enumerate(st) if y == 'G']:
            findr(i+j,j)
print(count)

### FIXED CODE ###

N = int(input())
S = input()
r = S.count('R')
g = S.count('G')
b = S.count('B')
count = r * g * b
for i in range(N):
    for j in range(i+1,N-1):
        if 2*j - i <= N-1:
            l = set([S[i],S[j],S[2*j-i]])
            if len(l) == 3:
                count -= 1
print(count)
### BUGGY CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
l = inpl()
dic = {}
for i in range(0, len(l)):
    dic.setdefault(i, l[i])
ans = ''
sl = sorted(dic.items(), key=lambda x:x[1])
for d in sl:
    ans = ''.join([ans,' ', str(d[0] + 1)])
print(ans)


### FIXED CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
l = inpl()
dic = {}
for i in range(0, len(l)):
    dic.setdefault(i, l[i])
ans = ''
sl = sorted(dic.items(), key=lambda x:x[1])
for d in sl:
    ans = ''.join([ans,' ', str(d[0] + 1)])
print(ans)
### BUGGY CODE ###

def main():
	L = input()
	n = len(L)
	MOD = 10**9+7
	ans = 0
	times = 1
	if n > 1:
		ans = (3**(n-1))
		times = 2
		ans %= MOD

	cur = 1
	if L[n-1] == "1":
		cur = 3

	for i in range(n-2, 0, -1):
		if L[i] == "1":
			cur *= 2
			cur %= MOD
			cur += (3**(n-i-1))
			cur %= MOD
	cur *= times
	cur %= MOD
	ans += cur
	ans %= MOD
	print(ans)


if __name__ == '__main__':
	main()

### FIXED CODE ###

MOD = 10**9+7

memo = dict()
memo[0] = 1
def pow3(n):
	if n in memo:
		return memo[n]
	if n%2 == 0:
		tmp = pow3(n//2)
		memo[n] = tmp*tmp%MOD
		return memo[n]
	memo[n] = 3 * pow3(n-1)%MOD
	return memo[n]

def cul(i, p):
	cur = (1<<i)%MOD
	cur *= pow3(p)
	return cur % MOD

def solve(L):
	n = len(L)
	if L == "0":
		return 1
	if not "0" in L:
		return pow3(n)

	num_1 = 0
	pos = []
	for i in range(n):
		if L[i] == "1":
			num_1 += 1
			pos.append(n-i-1)

	ans = (2**num_1)%MOD
	for i, p in enumerate(pos):
		ans += cul(i, p)
		ans %= MOD

	return ans

def main():
	L = input()
	print(solve(L))


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

n = int(input())
lis = sorted(list(map(int,input().split())))
count = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        ab = lis[i]+lis[j]
        if ab>lis[n-1]:
            count += n-1-j
        elif ab<=lis[j+1]:
            next
        else:
            l = j+1
            r = n-1
            m = int((r+l)/2)
            while r-l>1:
                if ab>lis[m]:
                    l = m
                else:
                    r = m
                m = int((r+l)/2)
            count += l-j
print(count)

### FIXED CODE ###

import bisect
n = int(input())
lis = sorted(list(map(int,input().split())))
count = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        index = bisect.bisect_left(lis,lis[i]+lis[j])
        count += index-1-j
print(count)
### BUGGY CODE ###

n = int(input())
x = int(input(),2)

def popcount2(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)

    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f

def popcount(n):
    return bin(n).count("1")

x_pop = popcount(x)
for i in reversed(range(0,n)):
    try:
        if x&(1<<i):
            tmp_pop = x_pop - 1
        else:
            tmp_pop = x_pop + 1
        tmp = (x^(1<<i)) % tmp_pop
        if tmp <= 0:
            print(1)
            continue
        cnt = 2
        tmp2 = tmp % popcount(tmp)
        while tmp2 > 0:
            tmp %= popcount(tmp)
            cnt += 1
            tmp2 %= popcount(tmp2)
        print(cnt)
    except:
        print(0)

### FIXED CODE ###

n = int(input())
s = input()
x = int(s, 2)
pcx = s.count("1")
pc1 = x % (pcx - 1) if pcx > 1 else 0
pc2 = x % (pcx + 1)

def f(j):
    cnt = 0
    while j:
        j %= bin(j).count("1")
        cnt += 1
    return cnt

for i, y in enumerate(s):
    k = n - 1 - i
    if y == "0":
        print(f((pc2 + pow(2, k, pcx + 1)) % (pcx + 1)) + 1)
    elif pcx > 1:
        print(f((pc1 - pow(2, k, pcx - 1)) % (pcx - 1)) + 1)
    else:
        print(0)
### BUGGY CODE ###

from itertools import*
N,K,Q,*A=map(int,open(0).read().split())
l=len
s=sorted
print(min(c[Q-1]-Y for c,Y in zip((s(sum((v[:l(v)-K+1]for v in(s(v)for k,v in groupby(A,lambda a:a>=Y)if k)if l(v)>=K),[]))for Y in A),A)if l(c)>=Q))

### FIXED CODE ###

N, K, Q, *A = map(int, open(0).read().split())

ans = float("inf")
for Y in A:
    C = []
    tmp = []
    for a in A:
        if a >= Y:
            tmp.append(a)
        else:
            if len(tmp) >= K:
                C += sorted(tmp)[:len(tmp) - K + 1]
            tmp = []
    if len(tmp) >= K:
        C += sorted(tmp)[:len(tmp) - K + 1]

    if len(C) >= Q:
        C.sort()
        X = C[Q - 1]
        ans = min(ans, X - Y)

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

# -*- coding:utf8 -*-

n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]
if k > q:
    for _ in range(n):
        print('Yes')
else:
    d = q - k + 1
    for i in range(1, n + 1):
        if a.count(i) >= d > 0:
            print('Yes')
        else:
            print('No')

### FIXED CODE ###

# -*- coding:utf8 -*-
from collections import Counter

n,k,q = map(int, input().split())
a = Counter([int(input()) for _ in range(q)])
if k > q:
    for _ in range(n):
        print('Yes')
else:
    d = q - k + 1
    for i in range(1, n + 1):
        if not a[i]:
            print('No')
        else:
            if a[i] >= d:
                print('Yes')
            else:
                print('No')
### BUGGY CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

# 1から順番に並べられたらOK
a = 1
c = 0
for i in range(N):
    if A[0] == a:
        # 確定した扱い
        a += 1
    else:
        # 取り除いた扱い
        c += 1
    A.pop(0)

print(c if a > 1 else -1)


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

# 1から順番に並べられたらOK
a = 1
c = 0
for i in range(N):
    if A[i] == a:
        # 確定した扱い
        a += 1
    else:
        # 取り除いた扱い
        c += 1

print(c if a > 1 else -1)
### BUGGY CODE ###

import sys
S = input()
Q = int(input())
pin = 0
for i in range(Q):
  t = list(sys.stdin.readline().split())
  if int(t[0]) == 1:
    if pin == 1:
      pin = 0
    else:
      pin = 1
  else:
    if int(t[1]) % 2 == pin :
      S = S + t[2]
    else:
      S = t[2] + S
if pin == 1:
  S = S[::-1]
print(S)


### FIXED CODE ###

import sys
S = input()
Q = int(input())
pin = 0
left = ''
right = ''
for i in range(Q):
  t = list(sys.stdin.readline().split())
  if int(t[0]) == 1:
    pin += 1
  else:
    if int(t[1]) % 2 == pin % 2 :
      right = right + t[2]
    else:
      left = t[2] + left
S = left + S + right
if pin % 2 == 1:
  S = S[::-1]
print(S)
### BUGGY CODE ###

n, k = [int(n) for n in input().split()]
h = [int(n) for n in input().split()]
dp = [0]*n

dp[1] = abs(h[1]-h[0])
for i in range(2, n):
  dp[i] = min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,min(i+1,k+1))])
print(dp[-1])

### FIXED CODE ###

def main():
  n, k = map(int, input().split())
  h = [int(n) for n in input().split()]
  dp = [0]*n
  for i in range(1, n):
    dp[i] = min([dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-k),i)])  
  print(dp[-1])

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

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    c = Counter(A)
    for a in A:
        ans = 0
        for k, v in c.items():
            if k == a: 
                ans += len(list(combinations(range(v-1), 2)))
            else:
                ans += len(list(combinations(range(v), 2)))

        print(ans) 


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    C = Counter(A)

    X = 0
    for v in C.values():
        X += v * (v - 1) // 2

    for i in range(N):
        print(X - C[A[i]] + 1)


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

h,w,a,b=map(int,input().split())
ans = 0

mod = 10**9 + 7
flist = [1] * (h+w+1)
for i in range(1,h+w):
    flist[i] = (flist[i-1] * i)

def cmb(n,r):
    return flist[n]//(flist[r]*flist[n-r])

for x in range(b,w):
    c = x + (h - a - 1)
    d = (w - x - 1) + (a - 1)
    e = cmb(c, x) * cmb(d, a - 1)
    ans = (ans+e)%mod

print(ans)

### FIXED CODE ###

h,w,a,b=map(int,input().split())
ans = 0

mod = 10**9 + 7
fac = [1] * (h+w+1)
inv = [1] * (h+w+1)
for i in range(1,h+w):
    fac[i] = (fac[i-1] * i)%mod
    inv[i] = pow(fac[i], mod-2, mod)

def cmb(n,r):
    return fac[n] * inv[r] * inv[n-r] % mod
    
for x in range(b,w):
    c = x + (h - a - 1)
    d = (w - x - 1) + (a - 1)
    e = cmb(c, x) * cmb(d, a - 1)
    ans = (ans+e)%mod

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

n=int(input())
s=str(input())
if n<=2:
    print(0)
    exit()
r=s.count('R')
g=s.count('G')
b=s.count('B')
ans=r*g*b
def moji(in1,in2):
    l=['R','G','B']
    l.remove(in1)
    l.remove(in2)
    return l[0]
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i]==s[j]:
            continue
        m=moji(s[i],s[j])
        if 2*j-i<=n-1:
          if s[2*j-i]==m:
            ans-=1
print(ans)

### FIXED CODE ###

n=int(input())
s=str(input())
if n<=2:
    print(0)
    exit()
r=s.count('R')
g=s.count('G')
b=s.count('B')
ans=r*g*b
for i in range(n-2):
    for j in range(i+1,n-1):
        if 2*j-i>n-1:
            break
        if s[i]!=s[j] and s[j]!=s[2*j-i] and s[i]!=s[2*j-i]:
            ans-=1
print(ans)
### BUGGY CODE ###

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

### FIXED CODE ###

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

for b2 in b:
    print(b2)