Harryxun/stf_run huggingface dataset:
# coding: utf-8
import sys
inputline = list(input()) #1文字ずつ文字のリストに
akihabara = list("AKIHABARA")

lineLength = len(akihabara) - len(inputline)
# 正解より文字数が多い、あるいは文字数が5文字以下のとき
if lineLength < 0 or lineLength >= 5:
    print("NO")
    sys.exit()
# 正解と文字数が同じとき
elif lineLength == 0:
    if inputline == akihabara:
        print("YES")
        sys.exit()
    else:
        print("NO")
        sys.exit()
# 正解より文字数が少ないとき
else:
    count=0
    for i in range(9):
        if i == 8 and len(inputline)<9:
            inputline.append("A")
        elif inputline[i] != akihabara[i]:
            inputline.insert(i, "A")

if inputline == akihabara:
    print("YES")
    sys.exit()
else:
    print("NO")
    sys.exit()

### FIXED CODE ###

# coding: utf-8
import sys
 
inputline = list(input()) #1文字ずつ文字のリストに
akihabara = list("AKIHABARA")

# Aの数
count = 4

lineLength = len(akihabara) - len(inputline)
for i in range( len(inputline) ):
    if inputline[i] == "A":
      count -= 1
#print(count)
# 正解より文字数が多い、あるいは文字数が5文字以下のとき
if lineLength < 0 or len(inputline)+count < 9 :
    print("NO")
# 正解と文字数が同じとき
elif lineLength == 0:
    if inputline == akihabara:
        print("YES")
    else:
        print("NO")
# 正解より文字数が少ないとき

else:
    for i in range(9):
        if i == 8 and len(inputline)<9:
            inputline.append("A")
        elif inputline[i] != akihabara[i]:
            inputline.insert(i, "A")
            
    if inputline == akihabara:
        print("YES")
    else:
        print("NO")
a,b,c,d=map(int,input().split())
print(max([a*c,a*d,b*c,c*d])


### FIXED CODE ###

a=list(map(int,input().split()))
print(max([a[0]*a[2],a[0]*a[3],a[1]*a[2],a[1]*a[3]]))
S = int(input())
h = S//3600
m = (S//60)-(S//3600)
s = S//60
print(h':'m':'s)



### FIXED CODE ###

S = int(input())
h = S//3600
m = (S//60)-60*(S//3600)
s = S%60
print('{}:{}:{}'.format(h,m,s))
import sys
input = sys.stdin.readline
import bisect
import numpy as np
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
x = max(max(a),max(b)).bit_length()+1
b = np.array(b)
ans = 0
for i in range(1,x+1):
  d = np.sort(np.bitwise_and(b,(1<<i)-1))
  t = 1<<(i-1)
  anstmp = 0
  for j in range(n):
    y = a[j]&(1<<i)-1
    t1 = np.searchsorted(d,t-y)
    t2 = np.searchsorted(d,2*t-y)
    t3 = np.searchsorted(d,3*t-y)
    t4 = np.searchsorted(d,4*t-y)
    anstmp += (t2-t1)+(t4-t3)
  if anstmp%2:
    ans += t
print(ans)

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b>=c:
  print("Yes")
else:
  print("No")
cnt = 0
n = int(input())
p = list(map(int, input().split())
for i in range(n):
  if int(i) + 1 != p[i] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")


### FIXED CODE ###

cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")
from collections import Counter
n, p = map(int, input().split( ))
s = input()

#p=2,5は例外
#例外でなければ累積和
if p==2:
    ans = 0
    for i in range(n):
        if int(s[i])%2==0:
            ans += i+1
    print(ans)
    exit()
if p==5:
    for i in range(n):
        if int(s[i])%5==0:
            ans += i+1
    print(ans)
    exit()
s = int(s)

accm = [0]

for i in range(n):
    si = s%(10**(i+1))
    sip = si%p
    accm.append(sip)

aC = Counter(accm)
ans = 0
for k in aC:
    ans += aC[k]*(aC[k]-1)//2
print(ans)


### FIXED CODE ###

from collections import Counter
n, p = map(int, input().split( ))
s = input()
#n,p = 10000,5
#s = "7"*10000
#p=2,5は例外
#例外でなければ累積和
if p==2:
    ans = 0
    for i in range(n):
        if int(s[i])%2==0:
            ans += i+1
    print(ans)
    exit()
if p==5:
    ans=0###
    for i in range(n):
        if int(s[i])%5==0:
            ans += i+1
    print(ans)
    exit()


accm = [0]
s = s[::-1]
#print(s)
sm = 0
beki_p = 1
for i in range(n):
    sm += int(s[i])*beki_p
    sm %=p
    accm.append(sm)
    beki_p *=10
    beki_p%=p

aC = Counter(accm)
ans = 0
for k in aC:
    ans += aC[k]*(aC[k]-1)//2
print(ans)
data = input()

if data.find('a') != -1 and data.find('b') != -1 and data.find('c') != -1:
	print 'Yes'
else:
  	print 'No'

### FIXED CODE ###

#!/bin/python
data = input()
 
if data.find('a') != -1 and data.find('b') != -1 and data.find('c') != -1:
    print('Yes')
else:
    print('No')
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  ptinr("Right")

### FIXED CODE ###

A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  print("Right")
import math
import numpy as np
N = int(input())
tb = [[0]*10]*10
tb = np.array(tb)
for i in range(1,N+1):
    s = str(i)
    tb[int(s[0])][int(s[-1])] =tb[int(s[0])][int(s[-1])] +1
 
point =0
 
for i in range(0,10):
    for j in range(0,10):
        point += tb[i][j] * tb[j][i]
 

### FIXED CODE ###

import math
import numpy as np
N = int(input())
tb = [[0]*10]*10
tb = np.array(tb)
for i in range(1,N+1):
    s = str(i)
    tb[int(s[0])][int(s[-1])] =tb[int(s[0])][int(s[-1])] +1
 
point =0
 
for i in range(0,10):
    for j in range(0,10):
        point += tb[i][j] * tb[j][i]
 
print(point)
S, W = int(inpit())

if S <= W:
    print('unsafe')
    elif S > W
    print('safe')
    

### FIXED CODE ###

S, W = map(int, input().split())

if S <= W:
    print('unsafe')
else:
    print('safe')
N, K = list(map(int, input().rstrip()))
ans = K * (K-1)**(N-1)
print(ans)

### FIXED CODE ###

N, K = list(map(int, input().rstrip().split()))
ans = K * (K-1)**(N-1)
print(ans)
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = sorted(a_list.count(i) for i in range(n+1),reverse = True)
print(n-sum(b_list[:k:]))

### FIXED CODE ###

import collections
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
b = collections.Counter(a_list)
d = b.most_common()[k:]
sum = 0
for i in d:
    sum += i[1]
print(sum)
import sys
N,M = map(int,input().split())
s = [0] * M
c = [0] * M
a = ["0"] * N
for i in range(M):
    s[i],c[i] = map(int,input().split())
for j in range(N):
    if s[j] == 1 and c[j] == 0:
        print(-1)
        sys.exit()
    elif a[s[j]-1] == "0":
        a[s[j]-1] = str(c[j])
    elif a[s[j]-1] == str(c[j]):
        pass
    else:
        print(-1)
        sys.exit()
ans = "".join(a)
print(ans)

### FIXED CODE ###

import sys
N,M = map(int,input().split())
s = [0] * M
c = [0] * M
a = ["-1"] * (N)
if N == 1 and M == 0:
    print(0)
    sys.exit()
for i in range(M):
    s[i],c[i] = map(int,input().split())

for j in range(M):
    if s[j] == 1 and c[j] == 0 and N != 1:
        print(-1)
        sys.exit()
    elif a[s[j]-1] == "-1":
        a[s[j]-1] = str(c[j])
    elif a[s[j]-1] == str(c[j]):
        pass
    else:
        print(-1)
        sys.exit()
if a[0] == "-1":
    a[0] = "1"
for h in range(1,N):
    if a[h] == "-1":
        a[h] = "0"
ans = "".join(a)
print(int(ans))
# じゃあ全部保存していってやるよ
n = int(input())
d = {}
arr = []
for _ in range(n):
    x = list(sorted(input()))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)


### FIXED CODE ###

# じゃあ全部保存していってやるよ
# atcoderのpython3のバージョンが古すぎて(3.4.3)TypeError: unhashable type: 'list'なるのでため息つきながら直した

n = int(input())
d = {}
arr = []
for _ in range(n):
    x = "".join(list(map(str, list(sorted(input())))))
    arr.append(x)
    if x not in d:
        d[x] = 1
    else:
        d[x] += 1

c = 0
for a in arr[:0:-1]:
    if d[a] > 0:
        c += d[a] - 1
        d[a] -= 1

print(c)
h, w = list(map(int, input().split()))
sharp = 0
data = []
for i in range(h):
    data.append(list(input()))
    sharp += data[i].count('#')
ans = []
def dfs(row, column, count,data):
    if(row > w - 1) or (column > h - 1) or ( row < 0 ) or ( column < 0 ):
        return

    if data[column][row] == '#':
        return

    data[column][row] = '#'

    if column == h - 1 and row == w - 1:
        count += 1
        ans.append(count)
        return

    else:

        dfs(row + 1, column,     count + 1,data)
        dfs(row,     column + 1, count + 1,data)
        dfs(row - 1, column,     count + 1,data)
        dfs(row,     column - 1, count + 1,data)
        return
dfs(0, 0, 0,data)
if len(ans) == 0:
    print(-1)
else:
    k = min(ans)
print(h * w - sharp - k)


### FIXED CODE ###

import collections
h, w = list(map(int, input().split()))
inf = h * w + 1
sharp = 0
data = []
for i in range(h):
    data.append(list(input()))
    # #の数を数えておく
    sharp += data[i].count('#')

ans = [[inf for i in range(w)] for j in range(h)]
def dfs(row, column, count,data):
    #もし配列の外を参照しているようであれば終了させる
    if(row > w - 1) or (column > h - 1) or ( row < 0 ) or ( column < 0 ):
        return

    if data[column][row] == '#':
        return
    data[column][row] == '#'
    #探索済みなので＃を入れたが、もっと良い方法があるかもしれない
    count += 1
    if row == w - 1 and column == h - 1:
        ans[column][row] = min(count, ans[column][row])
        return
    #その場所がゴールならば終了。ansにそこまでのコストを追加
    ##dataの写しを引数として渡したい。参照渡しか値渡しかを確認
    #+-1ずつ四方向に全探索
    dfs(row + 1, column,     count, data)
    dfs(row,     column + 1, count, data)
    dfs(row - 1, column,     count, data)
    dfs(row,     column - 1, count, data)
def bfs(row, column, count,data):
    becter = [-1,1]
    queue = collections.deque()
    queue.append([column, row,count])
    while len(queue) != 0:
        v = queue.popleft()
        if v[0] < 0 or v[1] < 0 or v[0] >= h or v[1] >= w:
            continue
        if data[v[0]][v[1]] != '#':

            data[v[0]][v[1]] = '#'
            v[2] += 1
            ans[v[0]][v[1]] = min(ans[v[0]][v[1]], v[2])
            queue.append([v[0] + 1, v[1],v[2]])
            queue.append([v[0], v[1] + 1,v[2]])
            queue.append([v[0] - 1, v[1],v[2]])
            queue.append([v[0], v[1] - 1,v[2]])


bfs(0, 0, 0,data)
if ans[-1][-1] == inf:
    print(-1)
    exit()
print(h * w - sharp - ans[-1][-1])
c1, _, _ = input().split()
_, c2, _ = input().split()
_, _, c3 = input().split()

print(c1 + c2 + c3)

### FIXED CODE ###

s1 = input()
s2 = input()
s3 = input()

print(s1[0] + s2[1] + s3[2])
import numpy as np
# -*- coding: utf-8 -*-
A, B, C, K = map(int, input().split())
W = np.array([[0,1,1], [1,0,1], [1,1,0]])
bef_X = np.array([A, B, C])
aft_X = np.linalg.matrix_power(W, K) @ bef_X

ans = aft_X[0] - aft_X[1]

print("{0}".format(ans if ans <= 10**18 else 'unfair'))

### FIXED CODE ###

import numpy as np
# -*- coding: utf-8 -*-
A, B, C, K = map(int, input().split())
W = np.array([[0,1,1], [1,0,1], [1,1,0]])
bef_X = np.array([A, B, C])
aft_X = np.dot(np.linalg.matrix_power(W, K),  bef_X)

ans = aft_X[0] - aft_X[1]

print("{0}".format(ans if ans <= 10**18 else 'unfair'))
S = input()
K = int(input())

# S = "11132"
# K = 2

ans = 1

for i in range(len(S)):
    if int(S[i]) == 1:
        pass
    else:
        ans = int(S[i])
        ones = i
        break

if K <= ones:
    ans = 1

print(ans)


### FIXED CODE ###

S = input()
K = int(input())

# S = "111111111"
# K = 6565

ans = 1
ones = -1

for i in range(len(S)):
    if int(S[i]) == 1:
        pass
    else:
        ans = int(S[i])
        ones = i
        break

if ones == -1:
    ones = len(S) + 1

if K <= ones:
    ans = 1

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

a.sort()
b_c = [list(map(int, input().split())) for _ in range(m)]
b_c.sort(key=lambda x: x[1], reverse=True)

j = 0
for i in range(m):
    b = b_c[i][0]
    c = b_c[i][1]
    for _ in range(b):
        if a[j] < c:
            a[j] = c
            j += 1
        else:
            break

print(sum(a))

### FIXED CODE ###

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

a.sort()
b_c = [list(map(int, input().split())) for _ in range(m)]
b_c.sort(key=lambda x: x[1], reverse=True)

j = 0
for i in range(m):
    b = b_c[i][0]
    c = b_c[i][1]
    for _ in range(b):
        if j >= n:
            print(sum(a))
            exit()
        if a[j] < c:
            a[j] = c
            j += 1
        else:
            break

print(sum(a))
s = input()
N = len(s)
for i in range(N-1):
    if s[i]==s[i+1]:
        print(i+1,i+2)
        break
    if i<N-1 and s[i]==s[i+2]:
        print(i+1,i+3)
else:
    print(-1,-1)

### FIXED CODE ###

s = input()
N = len(s)
for i in range(N-1):
    if s[i]==s[i+1]:
        print(i+1,i+2)
        break
    if i<N-2 and s[i]==s[i+2]:
        print(i+1,i+3)
        break
else:
    print(-1,-1)
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for x, y, a in P:
    if a == 1:  # ai=1
        X1 = max(X1, x)
    elif a == 2:  # ai=2
        X2 = min(X2, x)
    elif a == 3:  # ai=3
        Y1 = max(Y1, y)
    elif a == 4:  # ai=4
        Y2 = min(Y2, y)

if X1 < X2 and Y1 < Y2:
    S = (X2 - X1) * (Y2 - Y1)
else:
    S = 0
print(S)

### FIXED CODE ###

[a,b,c]=list(map(int,input().split()))
if a+b==c or a+c==b or b+c==a :
    print("Yes")
else:
    print("No")
n = int(input())
if x == 1:
  print("0")
else:
  print("1")

### FIXED CODE ###

n = int(input())
if n == 1:
  print("0")
else:
  print("1")
N=int(input())

def add(x):
    Len=len(str(x))
    up=int(str(x)[0])
    down=int(str(x)[Len-1])
    R=0
    if down!=0:
        if up<down:
            if Len>=3:
                R+=2*((10**(Len-2)-1)//9)
        elif up>down:
            R+=2*((10**(Len-1)-1)//9)
        else:
            R+=2*(((10**(Len-1)-1)//9)+1)-1
    return int(R)

def ans(y):
    if y==1:
        return 1
    else:
        return ans(y-1)+add(y)

#for i in range(1,N+1):
    #print(i,ans(i))

print(ans(N))



### FIXED CODE ###

import copy

N=int(input())

def arrange(List,n=N):  #先頭がup末尾がdownの総数をList[up][down]に入れる;Listは10×10で0が入ってる
    for i in range(1,n+1):
        Len=len(str(i))
        up=int(str(i)[0])
        down=int(str(i)[Len-1])
        List[up][down]+=1
    return List

original=[]
component=[]
for x in range(10):
    component.append(0)
for y in range(10):
    original.append(copy.deepcopy(component))


L=arrange(original)

ans=0

for j in range(10):
    for k in range(10):
        ans+=L[j][k]*L[k][j]

print(ans)
from math import gcd

n = int(input())
a = list(map(int, input().split()))
fromLeft = [0] * n
fromLeft[0] = a[0]
for i in range(1, n):
    fromLeft[i] = gcd(fromLeft[i - 1], a[i])
fromRight = [0] * n
fromRight[n - 1] = a[n - 1]
for i in range(n - 2, -1, -1):
    fromRight[i] = gcd(fromRight[i + 1], a[i])
ret = 0
for i in range(n):
    if i == 0:
        curGcd = fromRight[i + 1]
    elif i == n - 1:
        curGcd = fromLeft[n - 2]
    else:
        curGcd = gcd(fromLeft[i - 1], fromRight[n - i])
    ret = max(ret, curGcd)
print(ret)

### FIXED CODE ###

def gcd(x, y):
    while (y):
        x, y = y, x % y
    return x

n = int(input())
a = list(map(int, input().split()))
fromLeft = [0] * n
fromLeft[0] = a[0]
fromRight = [0] * n
fromRight[0] = a[n - 1]
for i in range(1, n):
    fromLeft[i] = gcd(fromLeft[i - 1], a[i])
    fromRight[i] = gcd(fromRight[i - 1], a[n - i - 1])
ret = fromLeft[n - 1]
for i in range(n):
    if i == 0:
        curGcd = fromRight[n - 2]
    elif i == n - 1:
        curGcd = fromLeft[n - 2]
    else:
        curGcd = gcd(fromLeft[i - 1], fromRight[n - i - 2])
    ret = max(ret, curGcd)
print(ret)
N,M = map(int,input().split())
S = input()
T = input()
import math
gcd_in = (math.gcd(N,M))
lcm_in =  M*N / gcd_in
if gcd_in == 1:
    print(M*M)
elif gcd_in == M or gcd_in == N:
    for i in range(gcd_in):
        counter=0
        if S[(N//gcd_in)*i] == T[(M//gcd_in)*i]:
            counter += 1
    if counter==gcd_in:
        print(max(N,M))
    else:
        print(-1)
else:
    for i in range(min(lcm_in/N,lcm_in/M)):
        counter=0
        if S[lcm_in/M*i] == T[lcm_in/N*i]:
            counter += 1
        if counter==(min(lcm_in/N,lcm_in/M)):
            print(lcm_in)
        else:
            print(-1)
        

### FIXED CODE ###

n,m = map(int,input().split())
s = input()
t = input()
#greatest common divisor/least common multiple
import fractions
gcd = int(fractions.gcd(n,m))
lcm = int(n*m/gcd)
counter=0
for i in range(gcd):
    if s[int(n/gcd)*i]!=t[int(m/gcd)*i]:
        print(-1)
        counter+=1
        exit()
if counter == 0:
    print(lcm)
H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())

S.sort（）
str1=''
str1.append(S[i] for i in range (H))

### FIXED CODE ###

H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())

S.sort()
str1=''
for i in range (H):
    str1=str1+S[i] 
print(str1)
N = int(input())
B = list(map(int, input().split()))
B_last = int(len(B))
A = B[0] + B[B_last - 1]
i = 1
old_b = B[1]
for i in range(N-1):
  #print("A =",A, "B =",B[i])
  b = B[i]
  if b >= old_b:
    A += old_b
    #print("A =",A)
  else:
    A += b
    #print(A)
  old_b = B[i]
  #print("A =",A, "B =",B[i],"old_b =", old_b)
#print("A =",A)
print(A)

### FIXED CODE ###

N = int(input())
ans = pow(N, 3)
print(ans)
N, M = map(int, input().split())

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

L = [list(map(int, input().split())) for _ in range(M)]

L.sort(reverse=True, key=lambda x:x[1])
A.sort()



ans = 0
i = 0
j = 0
k = 0
for i in range(N):
    if A[i] < L[j][1]:
        ans += L[j][1]
        k += 1
        
    else:
        ans += A[i]
        
    if k == L[j][0]:
        k = 0
        j += 1
        
print(ans)
    

### FIXED CODE ###

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

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

L = [list(map(int, input().split())) for _ in range(M)]

L.sort(reverse=True, key=lambda x:x[1])
A.sort()


ans = 0
i = 0
j = 0
k = 0
for i in range(N):
    if j < M:
        if A[i] < L[j][1]:
            ans += L[j][1]
            k += 1
            
        else:
            ans += A[i]
        
        
        if k == L[j][0]:
            k = 0
            j += 1
            
    else:
        ans += A[i]
        

        
print(ans)
import math
import itertools
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n, k = map(int, input().split())
d = [0]*k
d[0] = n-k+1
for i in range(1, k):
    a = cmb(k-1, i)/i
    div = math.ceil(a)
    if k % (i+1) == 0:
        d[i] = cmb(n-k+1, i+1)*(div-1) + 1
    else:
        d[i] = cmb(n-k+1, i+1)*div


    #     s = math.factorial(n-k+1)//math.factorial(i+1)
for i in d:
    print(i % (10 ** 9 + 7))


### FIXED CODE ###

import math


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


n, k = map(int, input().split())
mod = 10**9+7
for i in range(1, k+1):
    if n-k+1 >= i:
        print(comb(n-k+1, i)*comb(k-1, i-1) % mod)
    else:
        print(0)
# coding: utf-8
#-------------------------------------------------------------------
#-------------------------------------------------------------------
import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")
#-------------------------------------------------------------------
import math
def prm(n, r):
	return math.factorial(n)//math.factorial(n-r)

def cmb(n, r):
	return prm(n, r)//math.factorial(r)
#-------------------------------------------------------------------
def v(k):
	#p("B-1, k-1, cmb", B-1, k-1, cmb(B-1, k-1))
	p("R, k, cmb(R, k)",R, k, cmb(R, k))
#-------------------------------------------------------------------
MOD = 10**9+7
#-------------------------------------------------------------------


N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

B=K
R=N-K

A =[0]*(N+1)
AS=[0]*(N+1)




def calc(i):
	r = cmb(R+1, i)
	b = cmb(B-1, i-1)
	return r*b

for i in range(1,K+1):
	#v(i)
	print(calc(i)%MOD)
	#print(A[i])






### FIXED CODE ###

# coding: utf-8
#-------------------------------------------------------------------
#-------------------------------------------------------------------
import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")
#-------------------------------------------------------------------
import math
def prm(n, r):
	return math.factorial(n)//math.factorial(n-r)

def cmb(n, r):
	return prm(n, r)//math.factorial(r)
#-------------------------------------------------------------------
def v(k):
	#p("B-1, k-1, cmb", B-1, k-1, cmb(B-1, k-1))
	p("R, k, cmb(R, k)",R, k, cmb(R, k))
#-------------------------------------------------------------------
MOD = 10**9+7
#-------------------------------------------------------------------


N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

B=K
R=N-K


def calc(i):
	r = cmb(R+1, i) % MOD
	b = cmb(B-1, i-1) % MOD
	return (r * b) % MOD

for i in range(1,K+1):
	if R+1>=i:
		print( calc(i) )
	else:
		print(0)
import sys

x = abs(int(input()))
k = int(input())
d = int(input())

move_cnt = int(x / d)
if (move_cnt <= k):
    k -= move_cnt
    amari = x - move_cnt * d

else:
    amari = x - k * d
    k = 0

if (k > 0):
    if (k % 2 == 1):
        if (amari > 0):
            amari -= d
        else:
            amari += d

print(abs(amari))

### FIXED CODE ###

import sys

# x = abs(int(input()))
# k = int(input())
# d = int(input())

array = list(map(int, input().strip().split()))
x = abs(array[0])
k = array[1]
d = array[2]
if (d == 0):
    amari = abs(x)

else:
    move_cnt = int(x / d)
    if (move_cnt <= k):
        k -= move_cnt
        amari = x - move_cnt * d

    else:
        amari = x - k * d
        k = 0

    if (k > 0):
        if (k % 2 == 1):
            if (amari > 0):
                amari -= d
            else:
                amari += d

print(abs(amari))
r = int(raw_input())
pi = 3.14159265358

s = r * r * pi
l = 2 * r * pi

print s,l

### FIXED CODE ###

import math
r = float(raw_input())

s = r * r * math.pi
l = 2 * r * math.pi

print '%f %f' %(s,l)
a,b=map(int,input().split())
if ab<=0:
  print('Zero')
elif a>0:
  print('Positive')
elif b<0:
  if (b-a+1)%2==0:
    print('Positive')
  else:
    print('Negative')

### FIXED CODE ###

a,b=map(int,input().split())
if a*b<=0:
  print('Zero')
elif a>0:
  print('Positive')
elif b<0:
  if (b-a+1)%2==0:
    print('Positive')
  else:
    print('Negative')
a = input()
a = int(a)

b = a[0]+a[1]+a[2]
print(b)

### FIXED CODE ###

a = input()
b = int(a[0])+int(a[1])+int(a[2])
print(b)
n, p=map(int,input().split())
ans = 0
if n != 1:
    for i in range(1,int((p)**(1/2))+1):
        ni = i**n
        if p/ni >= 1 and p/ni == int(p/ni):
            ans = i
        elif p/ni < 1:
            break
    print(ans)
else:
    print(p)

### FIXED CODE ###

n, p=map(int,input().split())
ans = 0
if n != 1:
    for i in range(1,int((p+1)**(1/n))+1):
        ni = i**n
        if p/ni >= 1 and p/ni == int(p/ni):
            ans = i
        elif p/ni < 1:
            break
    print(ans)
else:
    print(p)