Harryxun/stf_run huggingface dataset:
def factorize(n):
    out=[]
    i = 2
    while 1:
        if n%i==0:
            out.append(i)
            n //= i
        else:
            i += 1
        if n == 1:break
        if i > int(n**.5+3):
            out.append(n)
            break
    
    return out
  
N = int(input())
f = factorize(N)[-1]
for i in range(1,10**7):
  if (f*i)*(f*i+1)%(2*N)==0:
    print(f*i)
    exit()

### FIXED CODE ###

import typing

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  
# https://github.com/not522/ac-library-python/blob/master/atcoder/math.py
def crt(r: typing.List[int], m: typing.List[int]) -> typing.Tuple[int, int]:
    assert len(r) == len(m)

    n = len(r)

    # Contracts: 0 <= r0 < m0
    r0 = 0
    m0 = 1
    for i in range(n):
        assert 1 <= m[i]
        r1 = r[i] % m[i]
        m1 = m[i]
        if m0 < m1:
            r0, r1 = r1, r0
            m0, m1 = m1, m0
        if m0 % m1 == 0:
            if r0 % m1 != r1:
                return (0, 0)
            continue

        # assume: m0 > m1, lcm(m0, m1) >= 2 * max(m0, m1)

        '''
        (r0, m0), (r1, m1) -> (r2, m2 = lcm(m0, m1));
        r2 % m0 = r0
        r2 % m1 = r1
        -> (r0 + x*m0) % m1 = r1
        -> x*u0*g % (u1*g) = (r1 - r0) (u0*g = m0, u1*g = m1)
        -> x = (r1 - r0) / g * inv(u0) (mod u1)
        '''

        # im = inv(u0) (mod u1) (0 <= im < u1)
        g, im = _inv_gcd(m0, m1)

        u1 = m1 // g
        # |r1 - r0| < (m0 + m1) <= lcm(m0, m1)
        if (r1 - r0) % g:
            return (0, 0)

        # u1 * u1 <= m1 * m1 / g / g <= m0 * m1 / g = lcm(m0, m1)
        x = (r1 - r0) // g % u1 * im % u1

        '''
        |r0| + |m0 * x|
        < m0 + m0 * (u1 - 1)
        = m0 + m0 * m1 / g - m0
        = lcm(m0, m1)
        '''

        r0 += x * m0
        m0 *= u1  # -> lcm(m0, m1)
        if r0 < 0:
            r0 += m0

    return (r0, m0)

def _inv_gcd(a: int, b: int) -> typing.Tuple[int, int]:
    a %= b
    if a == 0:
        return (b, 0)

    # Contracts:
    # [1] s - m0 * a = 0 (mod b)
    # [2] t - m1 * a = 0 (mod b)
    # [3] s * |m1| + t * |m0| <= b
    s = b
    t = a
    m0 = 0
    m1 = 1

    while t:
        u = s // t
        s -= t * u
        m0 -= m1 * u  # |m1 * u| <= |m1| * s <= b

        # [3]:
        # (s - t * u) * |m1| + t * |m0 - m1 * u|
        # <= s * |m1| - t * u * |m1| + t * (|m0| + |m1| * u)
        # = s * |m1| + t * |m0| <= b

        s, t = t, s
        m0, m1 = m1, m0

    # by [3]: |m0| <= b/g
    # by g != b: |m0| < b/g
    if m0 < 0:
        m0 += b // s

    return (s, m0)
  
N=int(input())
F = make_divisors(2*N)

ans = 10**20
for x in F:
  y = 2*N//x
  res,_ = crt([0,-1],[x,y])
  if res != 0:
    ans = min(ans,res)
  
print(ans)
from heapq import *
from collections import Counter

N = int(input())

A = list(map(int, input().split()))
A_indexed = [(a, i) for i, a in enumerate(A)]

def scores():
  # initial N:2N
  selected_left = A[:N] # min heap
  heapify(selected_left)
  l_score = sum(selected_left)

  temp = sorted(A[N:])
  selected_right = Counter(temp[:N])
  unselected_right_counter = Counter(temp[N:])
  unselected_right = list(unselected_right_counter.keys()) # min heap
  heapify(unselected_right)


  r_score = sum(selected_right)

  yield l_score-r_score

  for i,a in enumerate(A[N:2*N]):
    # left 使うものを減らす, right 使うものを増やす
    l_score -= heappushpop(selected_left, a)
    l_score += a
      
    if selected_right[a] > 0:
      r_score -= a
      selected_right[a] -= 1

      x = unselected_right[0]
      while unselected_right_counter[x] == 0:
        del unselected_right_counter[x]
        x = heappop(unselected_right)

      unselected_right_counter[x] -= 1
      selected_right[x] += 1
      r_score += x
    else:
      del selected_right[a]
      unselected_right_counter[a] -= 1

    yield l_score-r_score

print(max(scores()))

### FIXED CODE ###

from heapq import *

N = int(input())

A = list(map(int, input().split()))
A_indexed = [(a, i) for i, a in enumerate(A)]

def scores():
  # initial N:2N
  selected_left = A[:N] # min heap
  heapify(selected_left)
  l_score = sum(selected_left)

  temp = sorted(A_indexed[N:])
  selected_right_set = set(temp[:N])
  unselected_right = temp[N:] # min heap
  del temp
  r_score = sum(map(lambda x: x[0], selected_right_set))

  yield l_score,r_score

  for i in range(N, 2*N):
    a = A[i]
    # left 使うものを減らす, right 使うものを増やす
    if selected_left[0] < a:
      l_score -= heapreplace(selected_left, a)
      l_score += a
      
    if (a,i) in selected_right_set:
      r_score -= a
      selected_right_set.remove((a,i))

      n_element = heappop(unselected_right)
      while n_element[1] <= i:
        n_element = heappop(unselected_right)
      selected_right_set.add(n_element)
      r_score += n_element[0]

    yield l_score,r_score

# print(list(scores()))
print(max(map(lambda x: x[0]-x[1],scores())))
n,k=map(int,input().split())
lists=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  list.append(list)
num=[0]*n
for list in lists:
  for __ in range(len(list)):
    num[list[__]-1]+=1
count=0
for nn in num:
  if nn==0:
    count+=1
print(count)

### FIXED CODE ###

n,k=map(int,input().split())
lists=[]
for _ in range(k):
  d=int(input())
  lis=list(map(int,input().split()))
  lists.append(lis)
ans=[0]*n
for list in lists:
  for i in range(len(list)):
    ans[list[i]-1]+=1
count=0
for h in ans:
  if h==0:
    count+=1
print(count)
#!/usr/bin/env python

import sys
import re

_,a,b,c,d = [ int(x)-1 for x in sys.stdin.readline().split() ]
m = sys.stdin.readline().strip()
#
loc= []
for match in re.finditer( "##",m ): loc.append( match.start() )
if c>d:
    if m[b-1:b+2]!="..." and m[b+1:d+1].find("..")<0:
        print( "No" )
        exit()
#
# check b->d
flag= False
ii= b+1
jj= d-2
if ii<=jj:
    for l in loc:
        if ii<=l<=jj:
            flag=True
            break
if flag:
    print( "No" )
    exit()
#
# check a->c
ii= a+1
jj= c-2
if ii<=jj:
    for l in loc:
        if ii<=l<=jj:
            flag=True
            break
#
if flag:
    print( "No" )
    exit()
#
print( "Yes" )


### FIXED CODE ###

#!/usr/bin/env python

import sys
import re

s= sys.stdin.readline().strip()
s= s.replace("BC","D")
s= re.sub("[BC]+"," ",s).split()

t= 0
for seg in s:
    a= 0
    for c in seg:
        if c=="A": a+=1
        elif c=="D": t+= a
#
print( t )
A , B , N = map(int, input().split())

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

### FIXED CODE ###

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

if B > N:
    print(A*N//B)
else:
    print(A*(B-1)//B)
import math
import numpy as np

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def getNearestValue(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

n = int(input())
a = [int(i) for i in input().split()]
check = 0
a.sort()
b = a[-i]
c = getNearestValue(a,b/2)
ans = str(b) + ' ' + str(c)
print(ans)

### FIXED CODE ###

import math
import numpy as np

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def getNearestValue(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

n = int(input())
a = [int(i) for i in input().split()]
check = 0
a.sort()
b = a[-1]
c = getNearestValue(a,b/2)
ans = str(b) + ' ' + str(c)
print(ans)
(n,m),*a=[[*map(int,i.split())]for i in open(0)]
c=[0]*-~n
id={}
for p,y in sorted(a,key=lambda x:x[1]):
    c[p]+=1
    id[y]=str(p).zfill(6)+str(c[p]).zfill(6)
for _,y in a:
    print(id[y])

### FIXED CODE ###

n,m=map(int, input().split())
a=[list(map(int, input().split())) for _ in range(m)]
c=[0]*-~n
id={}
for p,y in sorted(a,key=lambda x:x[1]):
    c[p]+=1
    id[y]=format(p,"06")+format(c[p],"06")
for _,y in a:
    print(id[y])
import sys

def get_height(h, x, y, cx, cy):
	return h + abs(x - cx) + abs(y - cy)

n = int(input())
x = []
y = []
h = []
for _ in range(n):
	xi, yi, hi = map(int, input().split())
	if hi == 0:
		continue
	x.append(xi)
	y.append(yi)
	h.append(hi)

for cx in range(101):
	for cy in range(101):
		height = get_height(h[0], x[0], y[0], cx, cy)
        is_valid = True
		for i in range(1, len(x)):
			if height != get_height(h[i], x[i], y[i], cx, cy):
            	is_valid = False
				break
		if is_valid:
			print(cx, cy, height)
			sys.exit()

### FIXED CODE ###

import sys

def get_height(h, x, y, cx, cy):
	for i in range(len(h)):
		if h[i] == 0:
			continue
		return h[i] + abs(x[i] - cx) + abs(y[i] - cy)

n = int(input())
x = []
y = []
h = []
for _ in range(n):
	xi, yi, hi = map(int, input().split())
	x.append(xi)
	y.append(yi)
	h.append(hi)

for cx in range(101):
	for cy in range(101):
		height = get_height(h, x, y, cx, cy)
		for i in range(n):
			if h[i] != max(0, height - abs(x[i] - cx) - abs(y[i] - cy)):
				break
		else:
			print(cx, cy, height)
			sys.exit()
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u==s:
  a=a-1
else:
  b=b-1
print(a,b)

### FIXED CODE ###

s,t = input().split()
a,b = map(int,input().split())
u = input()
if u==s:
  a=a-1
else:
  b=b-1
print(a,b)
N, M =map(int,input().split())
ans=0

def fact(n):
    if n==0:
        return1:
    return n*fact(n-1)

if abs(N-M)>=2:
    print(0)
elif abs(N-M)==0:
    ans=fact(N)*4
elif abs(N-M)==1:
    ans=fact(N)*fact(M)
else:
    print(0)

ans=ans%(10**9+7)

print(ans)

### FIXED CODE ###

import math
N, M =map(int,input().split())
ans=0

if abs(N-M)==0:
    ans=math.factorial(N)*math.factorial(M)*2
elif abs(N-M)==1:
    ans=math.factorial(N)*math.factorial(M)
else:
    ans=0

ans=ans%(10**9+7)

print(ans)
N, K = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
C = [0]*40
for i in range(40):
  for a in A:
    if a & (2**(39-i)):
      C[i] += 1
dp = [[0]*2 for in range(41)]
for i in range(40):
  if K ＆ (2**(39-i)):
    temp1 = dp[i][0] + 2**(39-i)*C[i]
    temp2 = dp[i][1] + 2**(39-i)*max(C[i],N-C[i])
    dp[i+1][1] = max(temp1, temp2)
    dp[i+1][0] = dp[i][1] + 2**(39-i)*(N-C[i])
  else:
    dp[i+1][1] =  dp[i][1] + 2**(39-i)*max(C[i],N-C[i])
    dp[i+1][0] = dp[i][0] + 2**(39-i)*C[i]
print(max(dp[40]))
    

### FIXED CODE ###

N, K = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
A = [format(a,'b').zfill(40) for a in A]
C = [0]*40
for i in range(40):
    cc = 0
    for a in A:
        keta = 39 - i
        if a[keta] == "1":
            cc += 1
    C[keta] = cc
ans = 0
for i in range(40):
    b = 39 - i
    if C[i] < N - C[i]:#0の方が個数が多い→1を採用したいとき
        if K < 2**b:
            ans += (2**b * C[i])
        else:
            ans += (2**b * (N-C[i]))
            K -= 2**b
    else:
        ans += (2**b * C[i])
print(ans)
n = int(input())
print(int(n**.5)**2)

### FIXED CODE ###

s = input()
t = input()
print('YES' if s==t[::-1]  else 'NO')
W,H,x,y = input().split()
W,H,x,y = int(W),int(H),int(x),int(y)

cw = W//2
cH = H//2

if(cw==x):
    print(W*H//2)
    if(cH==y):
        print(1)
    else:
        print(0)
else:
    y0 = y-((y-cJ)/(x-cW))*x
    y1 = y-((y-cJ)/(x-cW))*(x-W)
    print((y0+y1)*W//2)
    print(0)

### FIXED CODE ###

W,H,x,y = input().split()
W,H,x,y = int(W),int(H),int(x),int(y)

cw = W/2
cH = H/2

if(cw==x):
    print(W*H/2)
    if(cH==y):
        print(1)
    else:
        print(0)

else:
    y0 = y-((y-cH)/(x-cw))*x
    y1 = y-((y-cH)/(x-cw))*(x-W)
    print((y0+y1)*W/2)
    print(0)
print(chr(ord(input()+1))

### FIXED CODE ###

print(chr(ord(input())+1))
while True:
        a,op,b=map(input().split())
        a=int(a)
        b=int(b)
                
        if op==('+'):
                print(a+b)
        elif op==('-'):
                print(a-b)
        elif op==('*'):
                print(a*b)
        elif op==('/'):
                print(a/b)
        elif op==('?'):
                break

~                                         


### FIXED CODE ###



while 1:
     s=input()
     if '?' in s: break
     print(int(eval(s)))
class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n + 1)]
        self.rank = [0 for _ in range(n + 1)]
        self.weight = [0 for _ in range(n + 1)]

    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            y = self.find(self.parent[x])
            self.weight[x] += self.weight[self.parent[x]]
            self.parent[x] = y
            return y

    def union(self, x, y, w):
        rx = self.find(x)
        ry = self.find(y)
        if self.rank[rx] < self.rank[ry]:
            self.parent[rx] = ry
            self.weight[rx] = w - self.weight[x] + self.weight[y]
        else:
            self.parent[ry] = rx
            self.weight[ry] = -w - self.weight[y] + self.weight[x]
            if self.rank[rx] == self.rank[ry]:
                self.rank[rx] += 1

    def check_same(self, x, y):
        return self.find(x) == self.find(y)

    def diff(self, x, y):
        return self.weight[x] - self.weight[y]


N = int(input())
p_list = list(map(int, input().split()))
unionfind = UnionFind(N)
for i in range(N - 1):
    p = p_list[i]
    p2 = p_list[i + 1]
    unionfind.union(p, p2, 1)

diff_list = []
for i in range(N):
    diff_list.append(unionfind.diff(i+1, p_list[i]))

count = 0
f = True
for i in range(len(diff_list)):
    if diff_list[i] == 0:
        diff_list[i+1] = -1
        count += 1
print(count)



### FIXED CODE ###

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

count = 0
for i in range(N-1):
    if p_list[i] == i + 1:
        count += 1
        p_list[i+1] = p_list[i]
if p_list[N-1] == N:
    count += 1
print(count)
#!/usr/bin/env python3
import sys
MOD = 1000000007  # type: int

def permutations_count(n, k):
    if k == 0:
        return 1
    return n * permutations_count(n-1, k-1) % MOD

def solve(N: int, K: int, a: "List[int]", b: "List[int]"):
    matrix = [[] for _ in range(N+1)]
    for i in range(N-1):
        matrix[a[i]].append(b[i])
        matrix[b[i]].append(a[i])
    
    visited = [0]*(N+1)

    from collections import deque
    queue = deque()
    visited[1]=1
    answer = K
    answer *= permutations_count(K-1,len(matrix[1]))
    for node in matrix[1]:
        queue.append(node)

    while queue:
        q = queue.popleft()

        if visited[q] == 0:
            answer *= permutations_count(K-2,len(matrix[q])-1) #親ノード引いてる
            answer%=MOD
        else:
            continue

        visited[q] = 1

        for child_node in matrix[q]:
            queue.append(child_node)

    print(answer%MOD)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, K, a, b)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
MOD = 1000000007  

def solve(N: int, K: int, a: "List[int]", b: "List[int]"):
    matrix = [[] for _ in range(N+1)]
    for i in range(N-1):
        matrix[a[i]].append(b[i])
        matrix[b[i]].append(a[i])
    
    visited = [0]*(N+1)

    from collections import deque
    queue = deque()
    visited[1]=1
    answer = K
    num = K-1
    for node in matrix[1]:
        answer *= num
        answer %= MOD

        num -= 1
        queue.append(node)

    while queue:
        q = queue.popleft()
        if visited[q] != 0:
            continue
        visited[q] = 1

        num = K-2
        for child_node in matrix[q]:
            if visited[child_node] == 0:
                answer *= num
                answer %= MOD
                num -= 1
                queue.append(child_node)
        answer %= MOD

    print(answer%MOD)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, K, a, b)

if __name__ == '__main__':
    main()
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s==u:
	print((a-1)+' '+b)
elif t==u:
	print(a+' '+(b-1))

### FIXED CODE ###

s, t = input().split()
a, b = map(int, input().split())
u = input()

if s==u:
	print(a-1, b)
elif t==u:
	print(a, b-1)
n, m = map(int, input().split())
a_pos = [0]*(n+1)
for i in range(m):
    a_pos[int(input())] = 1
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 0 if aL[0] == 1 else 1
for i in range(n-1):
    if a_pos[i+2] == 1:
        dp[i+2] = 0
    else:
        dp[i+2] = (dp[i] + dp[i+1]) % mod

print(dp[-1])

### FIXED CODE ###

n, m = map(int, input().split())
a_pos = [0]*(n+1)
for i in range(m):
    a_pos[int(input())] = 1
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 0 if a_pos[1] else 1
for i in range(2, n+1):
    if a_pos[i] == 1:
        dp[i] = 0
    else:
        dp[i] = (dp[i-2] + dp[i-1]) % mod

print(dp[-1])
n, l = map(int, input().split())
s = list()

for _ in range(n):
  s.append(input())

print(''.join(s.sort()))


### FIXED CODE ###

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

for _ in range(n):
  s.append(input())
  
s.sort()
print(''.join(s))
s = input()
origin = s
past = ''
cnt=0
while True:
    past = s
    s = s.replace('10','').replace('01','')
    print(s)
    print(past)
    if past==s:
        break

num = len(origin)-len(s)
print(num)

### FIXED CODE ###

s = input()
a = s.count('1')
b = s.count('0')

num = min(a,b)*2
print(num)
import math

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

a_b= [list(map(int, input().split())) for _ in range(N_H[0])]
length =len(a_b)

a= [a_b[i][0] for i in range(length)]
b= [a_b[i][1] for i in range(length)]

counter = 0
i = 0
pattern = 0


a_max = max(a)
a_max_idx = a.index(a_max)
b_a_max_idx = b[a_max_idx]

b.pop(a_max_idx)

b.sort()
b.reverse()

if N_H[1] <= b[a_max_idx]:
    print(1)
    
while True:
    if N_H[1] <= b_a_max_idx:
        counter += 1
        print(counter)
        break

    if i < length-1:    
        if b[i] > a_max:
            N_H[1] -= b[i]


            i += 1

            counter += 1

            if N_H[1] <= 0:
                print(counter)
    else:
        counter += math.ceil((N_H[1]-b_a_max_idx)/a_max)+1
        print(counter)
        break


### FIXED CODE ###

import math

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

a_b= [list(map(int, input().split())) for _ in range(N_H[0])]
length =len(a_b)

a= [a_b[i][0] for i in range(length)]
b= [a_b[i][1] for i in range(length)]

counter = 0
i = 0
pattern = 0


a_max = max(a)
b_max = max(b)
a_max_idx = a.index(a_max)
b_a_max_idx = b[a_max_idx]

b.pop(a_max_idx)

b.sort()
b.reverse()

    
while True:
    if N_H[1] <= b_max and counter == 0:
        counter += 1
        print(counter)
        break
    
    if N_H[1] <= b_a_max_idx:
        counter += 1
        print(counter)
        break

    if i <= length-2:    
        if b[i] > a_max:
            N_H[1] -= b[i]

            i += 1

            counter += 1

            if N_H[1] <= 0:
                print(counter)
                break
        else:
            counter += math.ceil((N_H[1]-b_a_max_idx)/a_max)+1
            print(counter)
            break
    else:
            counter += math.ceil((N_H[1]-b_a_max_idx)/a_max)+1
            print(counter)
            break
import sys
sys.setrecursionlimit(10**5)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
n,k=map(int,input().split())
ans=[0]*k
for i in range(k):
  ans = cmb(n-k+1,i+1)*cmb(k-1,i)
  print(ans%(10**9+7))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    r=min(r,n-r)
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
n,k=map(int,input().split())
ans=[0]*k

for i in range(k):
  if n-k<i:
    print(0)
    continue
  ans = cmb(n-k+1,i+1)*cmb(k-1,i)
  print(ans%(10**9+7))
S = int(input())
if S = AAA or BBB:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")
import sys
from collections import Counter
input = sys.stdin.readline

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

arr = [a[0] - 1]
for i in range(M-1):
    print(a[i], a[i+1])
    diff = a[i+1] - a[i] - 1
    arr.append(diff)
    if diff == 0:
        print(0)
        exit()
arr.append(N - a[-1] - 1)

count = [1, 1, 2]
for i in range(3, max(arr)+1):
    count.append(count[-1] + count[-2])

ans = 1
for value in arr:
    ans *= count[value]
    ans = ans % 1000000007

print(ans)




### FIXED CODE ###

import sys
input = sys.stdin.readline

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

if M > 0:
    for i in range(M-1):
        if a[i+1] - a[i] == 1:
            print(0)
            exit()

check = set(a)
if 1 in check:
    dp = [0, 0, 1]
elif 2 in check:
    dp = [0, 1, 0]
else:
    dp = [0, 1, 2]
if N < 3:
    print(dp[N])
    exit()
for i in range(3, N+1):
    if i in check:
        dp.append(0)
    else:
        dp.append((dp[-1] + dp[-2])%1000000007)

print(dp[-1])
n,k = map(int,inoput().split())
s = input()

print(s[:k-1]+s[k-1].lower+s[k:])

### FIXED CODE ###

_, K = map(int, input().split())
S = input()
 
print(S[: K - 1] + S[K - 1].lower() + S[K:])
n = int(input())
a = list(map(int,input().split()))

s = 0
u = -1
for i in a:
    t = 0
    for j in a:
        if j != i and i % j == 0:
            t += 1
    if j != i and t == 0:
        s += 1
print(s)




### FIXED CODE ###

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

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

#if x in p == False:
    #print(x)


for i in range(101):
    if ((x-i) in p) == False:
        print(x-i)
        break
    elif ((x+i) in p) ==False:
        print(x+i)
        break
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if AN <= K:
	print (AN)
else:
	print ('-1')


### FIXED CODE ###

a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
C = input()
if (C != 'z') and (C in a):
	i = a.index(C)
	print (a[i+1])
n,z,w=map(int,input())
a=[int(i) for i in input().split()]
print(max(abs(a[-1]-w),abs(a[-1]-a[-2])))

### FIXED CODE ###

n,z,w=map(int,input().split())
a=[int(i) for i in input().split()]
if n>=2:
    print(max(abs(a[-1]-w),abs(a[-1]-a[-2]) ))
else:
    print(abs(a[-1]-w))
N = int(input())
R = int(input())
 
if N < 10:
  n = R + 100 * (10 - N) 
  print(n)
  
if N >= 10:
  n = R
  print(n)

### FIXED CODE ###

N, R = (int(x) for x in input().split())
 
if N < 10:
  N = R + 100 * (10 - N) 
  print(N)
  
else:
  N = R
  print(N)
A,B = input()
C = A * B
print(A*B);

### FIXED CODE ###

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

print(a*b)