Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split())
L = [[] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    A = a - 1
    B = b - 1
    L[A].append(B)
    L[B].append(A)
BFS = list()
BFS.append([0])
ans = [[] for i in range(n - 1)]
while [] in ans:
    BFS.append([])
    for i in BFS[-2]:
        if L[i]:
            for j in L[i]:
                BFS[-1].append(j)
                ans[j - 1].append(i + 1)
                L[j].remove(i)
print('Yes')
for k in range(len(ans)):
    print(ans[k][0])

    

### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
bridge = [[] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    bridge[a - 1].append(b - 1)
    bridge[b - 1].append(a - 1)
queue = deque([0])
ans = [[] for i in range(n)]
ans[0].append('god')
while queue:
    now = queue.popleft()
    for factor in bridge[now]:
        if not (ans[factor]):
            ans[factor].append(now)
            queue.append(factor)
print('Yes')
for i in range(1, len(ans)):
    print(ans[i][0]+1)
for i in range(5):
  if int(input()) == 0:
    print(i + 1)

### FIXED CODE ###

arr = input().split();
for i in range(5):
	if(int(arr[i]) == 0): print(i + 1)
n, m = map(int, input().split())
nums = []

for i in range(n):
    nums.append(i + 1)

for i in range(m):
    l, r = map(int, input().split())
    nums = list(filter(lambda x: l <= x <= r, nums))
    if len(nums) == 0:
	print(0)
	break

print(len(nums))

### FIXED CODE ###

n, m = map(int, input().split())
lr = []

for i in range(m):
    lr.append(list(map(int, input().split())))

lmax = 0
mmin = 10**5

for i in range(m):
    lmax = max(lmax, lr[i][0])
    mmin = min(mmin, lr[i][1])

print(max(0, mmin - lmax + 1))
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    M = 0
    ret_M = []
    memo_N = [-1]*N # memo: 倍数を足したときに2で割った余り
    for i in range(N)[::-1]:
        i_ = i+1
        q = N//i_
        
        if q == 1:
            memo_N[i] = A[i]
            if A[i] == 1:
                M += 1
                ret_M.append(i_)
        else:
            memo_N[i] = memo_N[i_*2]^A[i]
            if memo_N[i]:
                M += 1
                ret_M.append(i_)
                
    print(M)
    if M: print(' '.join(map(str, ret_M[::-1])))
      
solve()

### FIXED CODE ###

def solve():
    N = int(input())
    A = list(map(int, input().split()))
    M = 0
    ret_M = []
    memo_N = [0]*N # memo: 倍数を足したときに2で割った余り
    for i in range(N)[::-1]:
        i_ = i+1
        q = N//i_
        s = sum(memo_N[i_*(d+1)-1] for d in range(1,q))
        memo_N[i] = (s%2)^A[i]
        if memo_N[i]:
            M += 1
            ret_M.append(i_)
                
    print(M)
    if M: print(' '.join(map(str, ret_M[::-1])))
      
solve()
a, b, c, d = map(int, raw_input().split())

if abs(a - b) < d and abs(b - c) < d or abs(a - c) < d:
	


### FIXED CODE ###

a, b, c, d = map(int, raw_input().split())

if abs(a - b) <= d and abs(b - c) <= d or abs(a - c) <= d:
	print 'Yes'
else:
	print 'No'
N = int(input())

sum = 0

V = list(map(int, input().split()))
C = list(map(int, input().split()))

for V_i, C_i in V, C:
  diff = V_i - C_i
  if diff >= 0:
    sum += diff

print(sum)

### FIXED CODE ###

N = int(input())

sum = 0

V = list(map(int, input().split()))
C = list(map(int, input().split()))

for i in range(N):
  diff = V[i] - C[i]
  if diff >= 0:
    sum += diff

print(sum)
N, K = map(int, input().split())
A = input().split()
A_MAP = {}
for i in range(N):
    A_MAP[str(i+1)] = A[i]

route_hash = {'1': 0}
current_pos = '1'
next_pos = ''
counter = 0
while counter <= K:
    next_pos = A_MAP[current_pos]
    counter+=1
    if next_pos in route_hash:
        break
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos

remain = K - counter
counter -= route_hash[next_pos]
remain = remain % counter

current_pos = next_pos
for i in range(remain):
    next_pos = A_MAP[current_pos]
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos
print(current_pos)


### FIXED CODE ###

N, K = map(int, input().split())
A = input().split()
A_MAP = {}
for i in range(N):
    A_MAP[str(i+1)] = A[i]

route_hash = {'1': 0}
current_pos = '1'
next_pos = ''
counter = 0
breaked = False
while counter < K:
    next_pos = A_MAP[current_pos]
    counter+=1
    if next_pos in route_hash:
        breaked = True
        break
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos

if not breaked:
    print(current_pos)
    exit()

remain = K - counter
counter -= route_hash[next_pos]
remain = remain % counter

current_pos = next_pos
for i in range(remain):
    next_pos = A_MAP[current_pos]
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos
print(current_pos)
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
ans=0
accum = [0]*(n+1)
accum[0]=0
for i in range(n):
    accum[i+1]=a[i]+accum[i]

z=Counter(accum)
for k,v in z:
    ans+=n(n-1)/2
    
print(ans)


### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
ans=0
accum = [0]*(n+1)
accum[0]=0
for i in range(n):
    accum[i+1]=a[i]+accum[i]

z=Counter(accum)
for k,v in z.items():
    ans+=v*(v-1)/2
    
print(int(ans))
# -*- coding: utf-8 -*-
 f, r = map(int, raw_input().split())
print(f - r + 1)

### FIXED CODE ###

# -*- coding: utf-8 -*-
f, r = map(int, raw_input().split())
print(f - r + 1)
N=int(input())

a==N//100
b==(N-(a*100))//10
c==(N-(a*100+b*10))

if (a == 7):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N=int(input())

a=N//100
b=(N-(a*100))//10
c=(N-(a*100+b*10))

if ((a == 7) or (b == 7) or (c == 7)):
    print("Yes")
else:
    print("No")
A, B, N = [int(v) for v in input().strip().spilt(" ")]

if N < B:
	print(int(A * N * B) - A * int(N / B))
else:
    print(int(A * (B - 1) * B) - A * int((B - 1) / B))

### FIXED CODE ###

A, B, N = [eval(v) for v in input().strip().split(" ")]

if N < B:
    print(int(A * N / B) - A * int(N / B))
else:
    print(int(A * (B - 1) / B) - A * int((B - 1) / B))
n=int(input())
hen_count=[0 for i in range(n+1)]
HEN=[]
for i in range(n-1):
  a,b=map(int,input().split())
  hen_count[a]+=1
  hen_count[b]+=1
  HEN.append([a,b])
print(max(hen_count))

qwe=max(hen_count)
color=[0]+[[i+1 for i in range(qwe)] for i in range(n)]

for q in HEN:
  p=max(min(color[q[0]]),min(color[q[1]]))
  color[q[0]].remove(p)
  color[q[1]].remove(p)
  print(p)

### FIXED CODE ###

import copy ; import sys ; sys.setrecursionlimit(11451419)
n=int(input())
HEN=[list(map(int,input().split())) for _ in range(n-1)]
G=[[] for _ in range(n)]
for i,[a,b] in enumerate(HEN):
    a=a-1;b=b-1
    G[a].append([b,i])
    G[b].append([a,i])  #Gに、道番号も記録

visited=[0 for i in range(n)]
ans=[-1 for i in range(n-1)]

def search(v,c=-1):  #search(a)ならaと-1  search(a,b)ならaとb
    nc=1
    for to,i in G[v]:
        if visited[to]==1: continue
        visited[v]=1
        if c==nc:
            nc+=1
        ans[i]=nc
        search(to,nc)
        nc+=1
search(0)
print(max(ans))
print(*ans,sep="\n")
a,b = map(int,input().split())

S  = (a-1)*(a-2)//2
def solve(x,y,s):
    print(a+s-y-1)
    for i in range(1,a):
        print(1,1+i)
    c = 0
    for i in range(2,a):
        for I in range(i+1,a):
            print(i,I)
            if c == s-a:break
# print(b,S)
if not 0<= b <= S:
    print(-1)
    exit()
else:
    solve(a,b,S)


### FIXED CODE ###

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

S  = (a-1)*(a-2)//2
def solve(x,y,s):
    print(a+s-y-1)
    for i in range(1,a):
        print(1,1+i)
    c = s-b
    for i in range(1,a):
        for I in range(i+1,a):
            if c > 0:
                print(i+1,I+1)
                c-=1
            else:exit()
# print(b,S)
if not 0<= b <= S:
    print(-1)
    exit()
else:
    solve(a,b,S)
x,y = map(int,input().split())
diff = abs(x-y)
mod = 10**9 + 7
if (x+y) % 3 != 0:
    print("0")
    exit()
else:
    cir = (min(x,y) - diff) // 3
    if cir < 0:
        print("0")
        exit()
    all_step = (x+y) // 3
    print(combination(all_step, cir, mod))


### FIXED CODE ###

def combination(n, r, mod):
    n1, r = n+1, min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod


x,y = map(int,input().split())
diff = abs(x-y)
mod = 10**9 + 7
if (x+y) % 3 != 0:
    print("0")
    exit()
else:
    cir = (min(x,y) - diff) // 3
    if cir < 0:
        print("0")
        exit()
    all_step = (x+y) // 3
    print(combination(all_step, cir, mod))
N, x = map(int, input().split())
a = [int(i) for i in input().split()]
ans = 0

if a[0] > x:
    ans += a[0] - x
    ans[0] = x

for i in range(1, N):
    if a[i] + a[i - 1] > x:
        ans += a[i] - (x - a[i - 1])
        a[i] = x - a[i - 1]

print(ans)

### FIXED CODE ###

N, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(N-1):
    if (a[i]+a[i+1]) > x and x < a[i] :
        ans += a[i+1]+a[i]-x
        
        a[i] = a[i]-(x-a[i+1])
        a[i+1] = 0
        
    elif (a[i]+a[i+1]) > x:
        ans += a[i+1]+a[i]-x
        
        a[i+1] = x-a[i]
        
print(ans)
N, Q = map(int, input().split())
S = input()
for _ in range(Q):
  l, r = map(int, input().split())
  print(len(re.findall('AC', S[l - 1:r])))


### FIXED CODE ###

from itertools import accumulate
from operator import add

N, Q = map(int, input().split())
S = input()
idx_list = [1 if S[i:i + 2] == 'AC' else 0 for i in range(len(S) - 1)]
idx_list_cumsum = [0] + list(accumulate(idx_list, add))

for _ in range(Q):
  l, r = map(int, input().split())
  print(idx_list_cumsum[r - 1] - idx_list_cumsum[l - 1])
A, B, K = (int(i) for i in input().split())
list = []

for i in range(1, 100):
  if i % A == 0 and i % B == 0:
    list.append(i)
print(list[K-1])


### FIXED CODE ###

A, B, K = (int(i) for i in input().split())
list = []
 
for i in range(101):
  if i != 0:
    if A % i == 0 and B % i == 0:
      list.append(i)
print(list[len(list)-K])
WHxyr = list(map(int, input(),split()))
x_max = WHxyr[0] - WHxyr[4]
y_max = WHxyr[1] - WHxyr[4]
if x >= r and x <= x_max:
    if y >= r and y <= y_max:
        print("Yes")
    else:
        print("No")
else:
    print("No")


### FIXED CODE ###

W,H,x,y,r = map(int, input().split())
x_max = W - r
y_max = H - r
if x >= r and x <= x_max:
    if y >= r and y <= y_max:
        print("Yes")
    else:
        print("No")
else:
    print("No")
s=int(input())
import math
ketamax=math.floor(s/3)

def kaijo(a,b):
    x=a
    for i in range(a+1,b+1):
        x=x*i
    return x

def comb(n, r):
    if r==0:
        return 1
    elif r==1:
        return n
    else:
        a=kaijo(n-r+1,n)/kaijo(1,r)
    return a

ans=0
for i in range(1,ketamax+1):
  nokori=s-3*i
  kazu=comb(nokori+i-1,i-1)
  ans+=kazu

waru=pow(10,9)+7
answer=int(ans%waru)
print(answer)

### FIXED CODE ###

s=int(input())
import math
ketamax=int(math.floor(s/3))

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

waru=pow(10,9)+7
ans=0
for i in range(1,ketamax+1):
  nokori=s-3*i
  kazu=cmb(nokori+i-1,i-1)%waru
  ans=(ans+kazu)%waru


answer=int(ans%waru)
print(answer)
from collections import deque

h,w = map(int,input().split())
ch, cw = map(int,input().split())
dh, dw = map(int,input().split())

G = []
for i in range(h):
    G.append(list(input()))

queue = deque([ch-1, cw-1])
S = [[float("inf")]*w for _ in range(h)]
S[ch-1][cw-1] = 0

while queue:
    y, x = queue.popleft()
    for i in range(-1, 2):
        for j in range(-1, 2):
            if i != 0 and j != 0:
                if 0 <= x+i < h and 0 <= y < w:
                    if S[y+j][x+i] > S[y][x] and G[y+j][x+i] == ".":
                        S[y+j][x+i] = S[y][x]
                        queue.appendleft((y+j, x+i))

    for i in range(-2, 3):
        for j in range(-2, 3):
            if i != 0 and j != 0:
                if 0 <= x+i < h and 0 <= y < w:
                    if S[y+j][x+i] > S[y][x] and G[y+j][x+i] == "."::
                        S[y+j][x+i] = S[y][x] + 1
                        queue.appendleft((y+j, x+i))


if S[dh+1][dw+1] == float("inf"):
    print(-1)
else:
    print(S[dh-1][dw-1])


### FIXED CODE ###

from collections import deque


h, w = map(int,input().split())
ch, cw = map(lambda x: int(x) - 1, input().split())
dh, dw = map(lambda x: int(x) - 1, input().split())

G = []
for i in range(h):
    G.append(list(input()))

queue = deque([(ch, cw)])
S = [[float("inf")]*w for _ in range(h)]
S[ch][cw] = 0

while queue:
    y, x = queue.popleft()
    dx_dy = ((1,0),(0,1),(-1,0),(0,-1))
    ans = S[y][x]

    if (y, x) == (dh, dw):
            S[y][x] = ans
            break

    for j, i in dx_dy:
        if 0 <= x+i < w and 0 <= y+j < h and S[y+j][x+i] > ans and G[y+j][x+i] == ".":
            queue.appendleft((y+j, x+i))
            S[y+j][x+i] = ans
            

    ans += 1
    for i in range(-2, 3):
        for j in range(-2, 3):
            if 0 <= x+i < w and 0 <= y+j < h and S[y+j][x+i] > ans and G[y+j][x+i] == ".":
                S[y+j][x+i] = ans
                queue.append((y+j, x+i))


if S[dh][dw] == float("inf"):
    print(-1)
else:
    print(S[dh][dw])
s = input()

if s = "Sunny":
  print("Cloudy")
elif s = "Cloudy":
  print("Rainy")
else:
  print("Sunny")
  

### FIXED CODE ###

s = input()

if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
x = (int(import()))
print(x ** 3)


### FIXED CODE ###

x = int(input())
print(x**3)
n=int(input())
a=list(input())
b=list(input())
ans=1
i=0
f=0
mod=1000000007
while k!=n:
    if i==0:
        if a[i]==b[i]:
            i+=1
            ans*=3
            ans%=mod
            f=1
        else:
            i+=2
            ans*=6
            ans%=mod
            f=2
    else:
        if a[i]==b[i] and f==1:
            i+=1
            ans*=2
            ans%=mod
            f=1
        elif a[i]==b[i] and f==2:
            i+=1
            f=1
        elif a[i]!=b[i] and f==1:
            i+=2
            ans*=2
            ans%=mod
            f=2
        else:
            i+=2
            ans*=2
            ans%=mod
            f=2
print(ans%mod)
            
        

### FIXED CODE ###

n=int(input())
a=list(input())
b=list(input())
ans=1
i=0
f=0
mod=1000000007
while i!=n:
    if i==0:
        if a[i]==b[i]:
            i+=1
            ans*=3
            ans%=mod
            f=1
        else:
            i+=2
            ans*=6
            ans%=mod
            f=2
    else:
        if a[i]==b[i] and f==1:
            i+=1
            ans*=2
            ans%=mod
            f=1
        elif a[i]==b[i] and f==2:
            i+=1
            f=1
        elif a[i]!=b[i] and f==1:
            i+=2
            ans*=2
            ans%=mod
            f=2
        else:
            i+=2
            ans*=3
            ans%=mod
            f=2
print(ans%mod)
s=input()
p=0; m=0
for i in range(0,len(s))
  if s[i]='+':
    p += 1
  else:
    m += 1
print(p-m)

### FIXED CODE ###

s=input()
p=0; m=0
for i in range(0,4):
  if s[i]=='+':
    p += 1
  else:
    m += 1
print(p-m)
A, B, K = map(int, input().split())
l = list(range(A, B+1))

for i in range(len(l)):
  if l[i] <= A + K - 1 or B - K + 1 <= l[i]:
    print(l[i])

### FIXED CODE ###

A, B, K = map(int, input().split())
l = []

if B - A + 1 > 2 * K:
  for i in range(K):
    l.append(A + i)
    l.append(B - i)
else:
  l = list(range(A, B+1))
  
l.sort()

for i in l:
  print(i)
def test(X, N, P):
  P_int = []
  
  for i in P:
    P_int.append(int(i))

  
  lis = []
  
  for i in list(range(101)):
    if i not in P_int:
      lis.append(i)
  
  min_adv = 1000
  min_num = 1000
  
  for i in lis:
    rec_adv = abs(X - i)
    
    if rec_adv < min_adv:
      min_num = i      
      min_adv = rec_adv
      
  print(min_num)

X, N = input().split()
P = input().split()

test(int(X), int(N), P)

### FIXED CODE ###

def test(total):
  if total == 14:
    print('1')
  elif total == 13:
    print('2')
  elif total == 12:
    print('3')
  elif total == 11:
    print('4')
  else:
    print('5')

x1, x2, x3, x4, x5 = input().split()
test(int(x1) + int(x2) + int(x3) + int(x4) + int(x5))
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("War")
        elif i = y:
            print("No War")
else:
    print("No War")

### FIXED CODE ###

# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
flag = 0

if max(xn) < min(ym):
    print("No War")
else:
    print("War")
from collections import Counter
n = int(input())
v = list(map(int,input().split()))
v1 = [v[0]]
v2 = []
for i in range(1,n):
    if i % 2 == 0:
        v1.append(v[i])
    else:
        v2.append(v[i])
c1 = Counter(v1)
c2 = Counter(v2)
mode1 = c1.most_common(1)
mode2 = c2.most_common(1)
if mode1[0][0] != mode2[0][0]:
    ans1 = len(v1)-mode1[0][1]
    ans2 = len(v2)-mode2[0][1]
    ans = ans1 + ans2
else:
    if mode1[0][1] == len(v1) and mode2[0][1] == len(v2):
       ans = min(mode1[0][1],mode2[0][1])
    else:
        ans1 = len(v)-mode1[0][1]-mode2[1][1]
        ans2 = len(v)-mode1[1][1]-mode2[0][1]
        ans = min(ans1,ans2)
print(ans)

### FIXED CODE ###

from collections import Counter

n = int(input())

e = []
o = []
for i, v in enumerate(input().split(' ')):
    if i % 2 == 0:
        e.append(int(v))
    else:
        o.append(int(v))

if len(set(e + o)) == 1:
    print(int(len(e + o) / 2))
    exit()

if Counter(o).most_common()[0][0] == Counter(e).most_common()[0][0]:
    ans = min(len(o) - Counter(o).most_common()[1][1] + len(e) - Counter(e).most_common()[0][1], len(o) - Counter(o).most_common()[0][1] + len(e) - Counter(e).most_common()[1][1])
    print(ans)
else:
    print(len(o) - Counter(o).most_common()[0][1] + len(e) - Counter(e).most_common()[0][1])
a,b,k = map(int,input().split())
#最大公約数を調べるためa,bのうつ値が最小値のものをsaiに代入
shou = min(a,b)
dai  = max(a,b)
min_list = []

for i in range(1,shou):
    if shou % i == 0:
        if dai % i == 0:
            min_list.append(i)

print(min_list[k-1])


### FIXED CODE ###

a,b,k = map(int,input().split())
#最大公約数を調べるためa,bのうつ値が最小値のものをsaiに代入
shou = min(a,b)
dai  = max(a,b)
min_list = []

for i in range(1,shou+1):
    if shou % i == 0:
        if dai % i == 0:
            min_list.append(i)

print(min_list[-k])
a,b,c=input().split()
if a==b and a==c:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

a=input()
if a[0]==a[1] and a[0]==a[2]:
  print("No")
else:
  print("Yes")
a,b=map(int,input().split())
n=list(map(int,input().split()))
n.sort(reverse=True)
for i in range(b):
  n.remove(n[i])
print(sum(n))  

### FIXED CODE ###

a,b=map(int,input().split())
n=list(map(int,input().split()))
n.sort(reverse=True)
n[0:b]=[]
print(sum(n))
n, k = map(int, input().split())
l = list(map(int, input().split()))
start = 1
seenl = []
seen = set()
for i in range(k):
	start = l[start-1]
	if start in seen:
		loop_len = len(seenl) - seenl.index(start)
		r = (k-i-1)%loop_len
		goal = seenl[seenl.index(start):][r]
		break
	seenl.append(start)
	seen.add(start)
print(goal)

### FIXED CODE ###

n,k = map(int,input().split())
*l, = map(int,input().split())
seenl = [1]
seen = {1}
temp=1
for i in range(k):
  temp=l[temp-1]
  if temp in seen:
    lenloop = len(seenl)-seenl.index(temp)
    r = (k-i-1)%lenloop
    temp = seenl[seenl.index(temp):][r]
    break
  seenl.append(temp)
  seen.add(temp)
print(temp)
nm = input()
n, m = nm.split()
n = int(n)
m = int(m)

arr = [[] for i in range(n)]

for i in range(m):
	ab = input()
	a, b = ab.split()
	a = int(a)
	b = int(b)
	arr[a-1].append(b)	

cnt = 0	
sting = 0
for i,isl in enumelate(arr):
	sting = isl[0]
	for j in arr[i:sting]:
		if (i == sting):
			cnt += 1
print(cnt)

### FIXED CODE ###

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

arr = [[] for i in range(n)]

for i in range(m):
	a, b = list(map(int, input().split()))
	arr[a-1].append(b)	

cnt = 0	
sting = n+1
for i,isl in enumerate(arr):
	isl.sort()
	if sting == i+1:
		cnt += 1
		sting = n+1

	if len(isl) == 0:
		continue
		
	if isl[0] < sting:
		sting = isl[0]
print(cnt)
h, w, a, b = [int(i) for i in input().split()]

p = 10 ** 9 + 7
s = 0

fact = [1]

for i in range(1, h+w-2):
    fact.append(fact[i-1] * i % p)

rfact = [(h+w-2) % p]

for i in range(h+w-1, 0, -1):
    rfact.append(rfact[-1] * i % p)

rfact.reverse()

def comb(n, r):
    return fact[n]//fact[n-r]//%pfact[r]%p

for i in range(w-b):
    s += comb(h+w-a-2-i, w-1-i) * comb(a-1+i, a-1)%p

print(s%p)

### FIXED CODE ###

import scipy.misc as scm

h, w, a, b = [int(i) for i in input().split()]

p = 10**9 + 7
ans = 0

def fact(n, p=10**9 + 7):
    f = [1]
    for i in range(1, n+1):
        f.append(f[-1]*i%p)
    return f

def invfact(n, f, p=10**9 + 7):
    inv = [pow(f[n], p-2, p)]
    for i in range(n, 0, -1):
        inv.append(inv[-1]*i%p)
    return inv[::-1]

f = fact(h+w)
rf = invfact(h+w, f)

for i in range(w-b):
    wi = b + i
    ans += (f[h-a+wi-1] * rf[h-a-1] % p * rf[wi] % p) * (f[a+w-wi-2] * rf[a-1] % p * rf[w-wi-1] % p) % p
    ans %= p 

print(ans)
s=input()

if (s=='ABC'):
  print('ARC')
else:
  prin('ABC')

### FIXED CODE ###

s=input()

if (s=='ABC'):
  print('ARC')
else:
  print('ABC')
import math

a, b = (int(i) for i in input().split())  
c = a * b
print(math.floor(c))

### FIXED CODE ###

import math
import re
from decimal import *

a = input()
b = int(re.sub('\s.+$','',a))
c = Decimal(re.sub('^.+\s','',a))
d = Decimal(b * c)
d = math.floor(d)
d = int(d)

print(d)
n, k = map(int, input().split())
a = list(map(int, input().split()))
dir = a[0]
hash_a = [False for _ in range(n)]
hash_a[0] = True
cnt = 0
while True:
    k -= 1
    cnt += 1
    if k == 0:
        break
    dir = a[dir - 1]
    if not hash_a[dir - 1]:
        hash_a[dir - 1] = True
    else:
        k %= cnt - 1
print(dir)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
dir = a[0]
hash_a = [0 for _ in range(n)]
hash_a[0] = 1
cnt = 0
two = 0
while True:
    k -= 1
    cnt += 1
    if k == 0:
        break
    dir = a[dir - 1]
    if hash_a[dir - 1] == 0 or hash_a[dir - 1] == 1 or hash_a[dir - 1] == 2:
        hash_a[dir - 1] += 1
        if hash_a[dir - 1] == 2:
            two += 1
    elif hash_a[dir - 1] == 3:
        k = (k + cnt) - (cnt - (two * 2))
        k %= two
        hash_a = [-k for _ in range(n)]
print(dir)
import math


def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

blue = K
red = N - K

num = 10 ** 9 + 7

for k in range(K):
    space_comb = combination_count(red + 1, k + 1)

    ball_comb = combination_count(K - 1, k)

    print((space_comb * ball_comb) % num)


### FIXED CODE ###

import math


def combination_count(n, r):
    if n - r < 0:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

blue = K
red = N - K

num = 10 ** 9 + 7

for k in range(K):
    space_comb = combination_count(red + 1, k + 1)

    ball_comb = combination_count(K - 1, k)

    print((space_comb * ball_comb) % num)