Harryxun/stf_run huggingface dataset:
import sys
from collections import Counter
from random import randrange

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c for j in range(b)] for i in range(a)]
def list3d(a, b, c, d): return [[[d for k in range(c)] for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10**9)
INF = 10**19
MOD = 10**9 + 7
EPS = 10**-10

N = INT()
A = LIST()
B = LIST()

C1 = Counter(A)
C2 = Counter(B)
for k, v in C1.items():
    if v > N-C2[k]:
        No()
        exit()

ans = B[ceil(N, 2):] + B[:ceil(N, 2)]

def check(A, B):
    for i in range(N):
        if A[i] == B[i]:
            return i
    return -1

def swap(x, A, B):
    for i in randrange(0, N):
        if A[x] != B[i] and A[i] != B[x]:
            B[x], B[i] = B[i], B[x]
            return True
    return False

while 1:
    res = check(A, ans)
    if res == -1:
        Yes()
        print(*ans)
        break
    else:
        if not swap(res, A, ans):
            No()
            break


### FIXED CODE ###

import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c for j in range(b)] for i in range(a)]
def list3d(a, b, c, d): return [[[d for k in range(c)] for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10**9)
INF = 10**19
MOD = 10**9 + 7
EPS = 10**-10

N = INT()
A = LIST()
B = LIST()

C1 = Counter(A)
C2 = Counter(B)
for k, v in C1.items():
    if v > N-C2[k]:
        No()
        exit()

ans = B[ceil(N, 2):] + B[:ceil(N, 2)]

def check(A, B):
    for i in range(N):
        if A[i] == B[i]:
            return i
    return -1

def swap(x, A, B):
    for i in range(N):
        if A[x] != B[i] and A[i] != B[x]:
            B[x], B[i] = B[i], B[x]
            return True
    return False

while 1:
    res = check(A, ans)
    if res == -1:
        Yes()
        print(*ans)
        break
    else:
        if not swap(res, A, ans):
            No()
            break
x,y=map(int,input().split())

print(min(x,y) max(x,y))

### FIXED CODE ###

while True:
 x,y=sorted ([int(x) for x in input().split()])
 if (x,y)==(0,0):
  break
 print(x,y)
from fractions import*
a,b=map(int,input().split())
c=a*b//gcd(a,b)
d=[0]*c
s=input()
t=input()
for i in range(a):
    d[i*(c//a)]=s[i]
for i in range(b):
    if d[i*(c//b)]!=t[i]:
        if d[i*(c//b)]==0:
            continue
        else:
            print(-1)
            exit()
print(c)

### FIXED CODE ###

from fractions import*
a,b=map(int,input().split())
c=gcd(a,b)
d=a*b//gcd(a,b)
s=input()
t=input()
for i in range(c):
    if s[i*(a//c)] != t[i*(b//c)]:
        print(-1)
        exit()
print(d)
a, b, c = int(input())

if b-a == c-b:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

a, b, c = [int(i) for i in input().split(' ')]

if b-a == c-b:
    print('YES')
else:
    print('NO')
#15frame  
H,W=(int(i) for i in input().split())
while H!=0 or W!=0:
    for i in range(H):
        S=""
    for j in range(W):
            S+="#"
        print(S)
    for i in range(H-2):
        S="#"
        for i in range(W-2):
            S+="."
        S+="#"
        print(S)
    S=""
    for i in range(W):
        S+="#"
    print(S)
    H,W=(int(i) for i in input().split())
    if H!=0 or W!=0:
    print("\n")

### FIXED CODE ###

# your code goes here
#15frame  
H,W=(int(i) for i in input().split())
while H!=0 or W!=0:
    S=""
    for i in range(W):
        S+="#"
    print(S)
    for i in range(H-2):
        S="#"
        for i in range(W-2):
            S+="."
        S+="#"
        print(S)
    S=""
    for i in range(W):
        S+="#"
    print(S,end="")
    H,W=(int(i) for i in input().split())
  #  if H!=0 or W!=0:
    print("\n")
S=list(input())
a=0
for i in S:
  if i==='+':
    a+=1
  else:
    a-=1
print(a)

### FIXED CODE ###

S=input()
a=0
for i in S:
  if i=='+':
    a+=1
  else:
    a-=1
print(a)
w = input().split('\n')
valid = False
for i in range(1,len(w)):
  if w[i][-1] == w[i+1][0] and len(set(w)) == len(w):
    valid = True
    return
  else:
    valid = False
   
  
  print("Yes" if valid else "No")

### FIXED CODE ###

# coding: utf-8
 
 
def is_unique(seq):
    return len(seq) == len(set(seq))
 
 
def main():
    n = int(input())
    shiri = True
 
    w = []
    for i in range(n):
        w.append(input())
 
    for i in range(n-1):
        if w[i][-1] != w[i + 1][0]:
            shiri = False
            break
 
    if not is_unique(w):
        shiri = False
 
    if shiri:
        print('Yes')
    else:
        print('No')
 
 
if __name__ == '__main__':
    main()
N = int(input())
X = list(map(int,input().split()))

minimum = 10000000

for n in range(1,N+1):
  d = 0
  for i in range(N):
    d += (X[i]-n)**2
  print(d)
  if kyori < minimum:
    minimum = kyori
print(minimum)

### FIXED CODE ###

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

minimum = 10000000

for n in range(1,max(X)+1):
  kyori = 0
  for i in range(N):
    kyori += (X[i]-n)**2
  if kyori < minimum:
    minimum = kyori
print(minimum)
import math
n = input()
c = 0


for i in range(int(n)):
    x = int(input())
    if x == 1:
        x = 0
    for j in range(2,math.floor(math.sqrt(float(x)))+ 1):
        if x % j == 0:
            x = 0
            break
        if x != 0:
            c += 1	
print(c)

### FIXED CODE ###

import math
n = int(input())
count = 0
for i in range(n):
    a = int(input())
    for j in range(2,int(math.sqrt(a) + 1)):
        if a % j == 0:
            break
    else:
        count += 1  
print(count)
s = input()
k = int(input())

for i in len(s):
    if s[i] != "1" and i+1 <= k:
        print(s[i])
        exit()

print(1)

### FIXED CODE ###

s = input()
k = int(input())

for i in range(len(s)):
    if s[i] != "1" and i+1 <= k:
        print(s[i])
        exit()

print(1)
N,T = map(int,input().split())
import numpy as np
A = []
B = []
C = []
for i in range(N):
    a,b = map(int,input().split())
    C.append([a,b])
C.sort()
dp = [[0 for i in range(T)]for j in range(N+1)]
for i in range(1,N+1):
    a,b = C[i-1][0],C[i-1][1]
    for t in range(1,T):
        p = dp[i-1][t]
        if t >= a:
            q = dp[i-1][t-a] + b
            dp[i][t] = max(p,q)
        else:
            dp[i][t] = p
M = 0
for i in range(1,N+1):
    M = max(M,C[i-1][1]+dp[i-1][T-1])
print(M)

### FIXED CODE ###

N,T = map(int,input().split())
C = []
for i in range(N):
    a,b = map(int,input().split())
    C.append([a,b])
C.sort()
dp = [[0 for i in range(T)]for j in range(N+1)]
for i in range(1,N+1):
    a,b = C[i-1][0],C[i-1][1]
    for t in range(1,T):
        p = dp[i-1][t]
        if t >= a:
            q = dp[i-1][t-a] + b
            dp[i][t] = max(p,q)
        else:
            dp[i][t] = p
M = 0
for i in range(1,N+1):
    M = max(M,C[i-1][1]+dp[i-1][T-1])
print(M)
x = int(input())

print x 

### FIXED CODE ###

x = int(input())
y = x**3
print(y)
from __future__ import division, print_function
from sys import stdin, maxint
 
 
def main():
    num = int(stdin.readline())
 
    y = []
    for _ in xrange(num):
        it = iter(int(s) for s in stdin.readline().split()[1:])
        y.append([(next(it), next(it)) for _ in xrange(next(it))])
    weight = [maxint] * num
    weight[0] = 0
    t = set(xrange(1, num))
    index = 0
 
    while t:
        for v, cost in y[index]:
            if v not in t:
                continue
            weight[v] = min(weight[v], cost + weight[index])

         index = min(t, key=lambda i: weight[i])
        t.remove(index)

    for i, d in enumerate(weight):
        print(i, d)
 
 
main()

### FIXED CODE ###

from __future__ import division, print_function
from sys import stdin, maxint
 
 
def main():
    x = int(stdin.readline())
 
    y = []
    for _ in xrange(x):
        y.append([int(s) for s in stdin.readline().split()])
 
    g = set(xrange(1, x+1))
    index = g.pop()
    h = {index}
    leng = 0
 
    while g:
        minimum = maxint

        for j in h:
            mj = y[j-1]
            for i in g:
                if 0 <= mj[i-1] < minimum:
                    index = i
                    minimum = mj[i-1]

        h.add(index)
        g.remove(index)
        leng += minimum
 
    print(leng)
 
 
main()
N = int(raw_input())
K = int(raw_input())

if K ==1:
      print(0)
else:
      print(N-K)


### FIXED CODE ###

N,K =map(int, raw_input().split(" "))


if K == 1:
      print(0)
else:
      print(N-K)
s = input()
k = int(input())
flag = 1
for i in range(min(k,len(s))):
    if s[i]!='1':
        flag = 0
        break
if flag:
    print(1)
else:
    print(s[1])


### FIXED CODE ###

s = input()
k = int(input())
flag = 1
for i in range(min(k,len(s))):
    if s[i]!='1':
        flag = 0
        a = s[i]
        break
if flag:
    print(1)
else:
    print(a)
from sys import stdin

param = input().split()
A=param[0]
B=param[1]
C=param[2]

hituyou=A-B
if hituyou<=C :
  nokori = C-hituyou
elif hituyou>C:
  nokori = 0
  
print(nokori)

### FIXED CODE ###

from sys import stdin

param = input().split()
A=int(param[0])
B=int(param[1])
C=int(param[2])

hituyou=A-B
if hituyou<=C :
  nokori = C-hituyou
elif hituyou>C:
  nokori = 0
  
print(nokori)
x*x*x


### FIXED CODE ###

x=int(input())
print(x**3)
s=list(set(input()))
test=["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"]
test.sort()
s.sort()
if len(s)==len(test):
    print("None")
    exit()
i=0
while True:
    if test[i]!=s[i]:
        print(test[i])
        break
    i+=1


### FIXED CODE ###

s=list(set(input()))
test=["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"]
test.sort()
s.sort()
if len(s)==len(test):
    print("None")
    exit()

i=0
while True:
    if len(s)<=i:
        print(test[i])
        break
        
    if test[i]!=s[i]:
        print(test[i])
        break
    i+=1
a=int(input())
b=int(input())
if a>=10:
    print(-1)
elif b>=10:
    print(-1)
else:
    print(a*b)

### FIXED CODE ###

a,b=map(int,input().split())
if(a>=10):
    print(-1)
elif(b>=10):
    print(-1)
else:
    print(a*b)
# https://atcoder.jp/contests/abc068/tasks/arc079_a
# C - Cat Snuke and a Voyage

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

for _ in range(m):
    a, b = list(map(int, input().split()))
    ab_list.append((a, b))

ab_dict = {k: [] for k in range(1, m+1)}

for a, b in ab_list:
    # 子供を覚えさせる
    ab_dict[a].append(b)

next_node_list = ab_dict[1]
# 来訪済の島
done_list = []
done_list.append(1)

def search(node_list):
    for node in node_list:
        if node == n:
            return True

    return False

# 深さ優先探索
for node in next_node_list:
    if node not in ab_dict.keys():
        # 行き止まり
        is_ok = False
        continue

    if node == n:
        is_ok = True
    else:
        is_ok = search(ab_dict[node])
    if is_ok:
        break

ans = 'POSSIBLE' if is_ok else 'IMPOSSIBLE'
print(ans)


### FIXED CODE ###

# https://atcoder.jp/contests/abc068/tasks/arc079_a
# C - Cat Snuke and a Voyage

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

for _ in range(m):
    a, b = list(map(int, input().split()))
    ab_list.append((a, b))

ab_dict = {k: [] for k in range(1, m+1)}

# 1と接続している島
via_nodes_1 = set([b for a, b in ab_list if a == 1])
via_nodes_2 = set([a for a, b in ab_list if b == n])

# 積集合があるか
via_nodes = via_nodes_1 & via_nodes_2

if len(via_nodes):
    ans = 'POSSIBLE'
else:
    ans = 'IMPOSSIBLE'

print(ans)
print(1000-int(input())%1000 if int(input())%1000 !=0 else 0)

### FIXED CODE ###

n = int(input())
mod = n%1000
print(1000-mod if mod !=0 else 0)
import math
ans=0
A=[int(input()) for i in range(5)]
a=10
for i in range(5):
  if a>A[i]:
    p=i
    a=A[i]
for i in range(5):
  if i==p:
    ans+=A[i]
  else:
    ans+=10*(math.ceil(A[i]/10))
print(ans)

### FIXED CODE ###

import math
ans=0
A=[int(input()) for i in range(5)]
a=10
p=0
for i in range(5):
  if a>(A[i]%10) and A[i]%10!=0:
    p=i
    a=A[i]%10
for i in range(5):
  if i==p:
    ans+=A[i]
  else:
    ans+=10*(math.ceil(A[i]/10))
print(ans)
def distance(a,b,c,d):
  return abs(a-c)+abs(b-d)

N,M=map(int, input().split())
Alist = []
Blist = []
for i in range(N):
  a,b=map(int, input().split())
  Alist.append(a)
  Blist.append(b)
Clist = []
Dlist = []
for i in range(M):
  c,d=map(int, input().split())
  Clist.append(c)
  Dlist.append(d)

for i in range(N):
  min_d = 10*10
  a = Alist[i]
  for k in range(M):
    b = Blist[k]
    if min_d > distance(a[0],a[1],b[0],b[1]):
      min_d = distance(a[0],a[1],b[0],b[1])
      kiroku = k
  print(k)


### FIXED CODE ###

def distance(a,b,c,d):
  return abs(a-c)+abs(b-d)

N,M=map(int, input().split())
Alist = []
Blist = []
for i in range(N):
  a,b=map(int, input().split())
  Alist.append(a)
  Blist.append(b)
Clist = []
Dlist = []
for i in range(M):
  c,d=map(int, input().split())
  Clist.append(c)
  Dlist.append(d)

for i in range(N):
  min_d = 10**10
  a = Alist[i]
  b = Blist[i]
  for k in range(M):
    c = Clist[k]
    d = Dlist[k]
    if min_d > distance(a,b,c,d):
      min_d = distance(a,b,c,d)
      kiroku = k
#    print(a,b,c,d,distance(a,b,c,d),min_d)
  print(kiroku+1)
N = int(input())
A = [int(x) for x in input().split()]
mod = 10**9+7
c = 1-N%2
flag = True
di = {}
if(N==1):
    if(A[0]==0):
        print(1)
    else:
        print(0)
else:
    for i in A:
        if(i not in di):
            di[i]=1
        else:
            di[i]+=1
    for i in range(N//2):
        if(i+c==0):
            flag &= (di[i]==1)
        else:
            flag &= (di[i*2+c]==2)
        if(not flag):

            else:
                print(0)
            break
    else:
        print((2<<(N//2-1))%mod)


### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]
mod = 10**9+7
c = 1-N%2
flag = True
di = {}
if(N==1):
    if(A[0]==0):
        print(1)
    else:
        print(0)
else:
    for i in A:
        if(i not in di):
            di[i]=1
        else:
            di[i]+=1
    for i in range(N//2):
        if(i+c==0):
            if(0 not in di):
                flag = False
            else:
                flag &= (di[i]==1)
        else:
            if(i*2+c not in di):
                flag = False
            else:
                flag &= (di[i*2+c]==2)
        if(not flag):
            print(0)
            break
    else:
        print((2<<(N//2-1))%mod)
N = int(input())
X = list(map(int,input()))
import math
P = sum(X)/len(X)
count = 0
for i in range(N):
  count += (X[i] - P)**2
print(math.ceil(count))

### FIXED CODE ###

N = int(input())
X = list(map(int,input().split()))
P = sum(X)/len(X)
P = round(P)
count = 0
for i in range(N):
  count += (X[i] - P)**2
print(count)
n = int(input())
a = list(map(int, input().split()))

A = max(a)

cnt = [0]*(A+1)
uq = []

for i in a:
    cnt[i] += 1

for i in range(A+1):
    if cnt[i] == 1:
        uq.append(i)

cnt = [0]*((10**6)+1)
cnt1 = 0


a = list(set(a))



for i in a:
    for j in range(2,A+1):
            cnt[i*j] = 1


for i in uq:
    if cnt[i] == 0:
        cnt1 += 1

print(cnt1)


### FIXED CODE ###

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

A = max(a)

cnt = [0]*(A+1)
uq = []

for i in a:
    cnt[i] += 1

for i in range(A+1):
    if cnt[i] == 1:
        uq.append(i)

cnt = [0]*((10**6)+1)
cnt1 = 0


a = list(set(a))

# for i in a:
#     for j in range(2,A+1):
#         if i*j<=A+1:
#             cnt[i*j] = 1

for elem in a:
    for m in range(elem * 2, (10 ** 6) + 1, elem):
        cnt[m] = 1

for i in uq:
    if cnt[i] == 0:
        cnt1 += 1

print(cnt1)
n=int(input())
s=input()
if len(s)<=n:
  print(s)
else:
  print(s[:n,'...',sep=''])

### FIXED CODE ###

n=int(input())
s=input()
if len(s)<=n:
  print(s)
else:
  print(s[:n],'...',sep='')
import sys

N=sys.argv[1]
te=sys.argv[2:]

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")


### FIXED CODE ###

import sys



N=raw_input()
te=raw_input()

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")
import numpy as np
N = int(input())
A = np.array([int(x) for x in input().split()])
mi= np.min(A)
ma= np.max(A)
mai = np.where(A==ma)
mii = np.where(A==mi)
ans = []
if ma<=0 and mi<=0:
  for i in range(N,1,-1):
    ans.append((i,i-1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()
if ma>=0 and mi>=0:
  for i in range(1,N):
    ans.append((i,i+1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()

if abs(mi)<abs(ma):
  ans= [(int(mai[0]),i) for i in range(1,N+1)]
  for i in range(1,N):
    ans.append((i,i+1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()
else:
  ans= [(int(mii[0]),i) for i in range(1,N+1)]
  for i in range(N+1,1,-1):
    ans.append((i,i-1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()

### FIXED CODE ###

import numpy as np
N = int(input())
A = np.array([int(x) for x in input().split()])
mi= np.min(A)
ma= np.max(A)
mai = np.where(A==ma)
mii = np.where(A==mi)
ans = []
if ma<=0 and mi<=0:
  for i in range(N,1,-1):
    ans.append((i,i-1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()
if ma>=0 and mi>=0:
  for i in range(1,N):
    ans.append((i,i+1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()

if abs(mi)<=abs(ma):
  ans= [(int(mai[0][0])+1,i) for i in range(1,N+1)]
  for i in range(1,N):
    ans.append((i,i+1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()
else:
  ans= [(int(mii[0][0])+1,i) for i in range(1,N+1)]
  for i in range(N,1,-1):
    ans.append((i,i-1))
  print(len(ans))
  for i in range(len(ans)):
    print(*ans[i])
  exit()
a = int(input())
b = int(input())
if a>b: print("GREATER")
elif a<b: print("LESS")
else: print("EQUAL")

### FIXED CODE ###

a,b,c = (i for i in input().split())
x = a[0]+b[0]+c[0]
x = x.upper()
print(x)
word=input()
while(1):
  sentence=input()
  if sentence == "END_OF_TEXT"
    break
  
  snt=sentence.lower()


cnt=sentence.count(word)
print(cnt)

### FIXED CODE ###

w= input().casefold()
 
cnt = 0
 
while(1):
    snt = input()
    if snt == "END_OF_TEXT":
        break
    sntt = snt.casefold()
    words = sntt.split()
    cnt += words.count(w)
     
print(cnt)
a=list(map(int,input().split()))
b=a.sorted()
print(b[1]*b[2])


### FIXED CODE ###

a=sorted(list(map(int,input().split())))
print(a[0]*a[1]//2)
import sys
from collections import deque

# sys.stdin = open('input.txt', 'r')

s = deque([s for s in input()])
q = int(input())
rev = False

for query in sys.stdin:
    if query.strip() == '1': # sys.stdin does not remove line breaks. (vs. input() removes line breaks)
        if rev:
            rev = False
        else:
            rev = True
    else:
        t,f,c = query.split()
        if f == '1':
            if rev == True:
                s.append(s)
            else:
                s.appendleft(c)
        elif f == '2':
            if rev == True:
                s.appendleft(c)
            else:
                s.append(c)
if rev == True:
    s.reverse()
print(''.join(s))

### FIXED CODE ###

import sys
from collections import deque

# sys.stdin = open('test_cases/abc158d/in/01.txt', 'r')
# sys.stdin = open('input.txt', 'r')

s = deque([s for s in input()])
q = int(input())
rev = False

for query in sys.stdin:
    if query.strip() == '1': # sys.stdin does not remove line breaks. (vs. input() removes line breaks)
        if rev:
            rev = False
        else:
            rev = True
    else:
        t,f,c = query.split()
        if f == '1':
            if rev:
                s.append(c)
            else:
                s.appendleft(c)
        elif f == '2':
            if rev:
                s.appendleft(c)
            else:
                s.append(c)
if rev == True:
    s.reverse()
print(''.join(s))
from math import floor 
from fractions inport Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(floor(A*B))

### FIXED CODE ###

from math import floor 
from fractions import Fraction

A, B = input().split()
A = int(A)
B = Fraction(B)
print(floor(A*B))
#!/usr/bin/env python
# coding: utf-8

# In[18]:


S = input()


# In[19]:


mylist = list(sorted(set(S)))
abc = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(abc)):
    if mylist[i] != abc[i]:
        print(abc[i])
        break
else:
    print("None")


# In[ ]:






### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8

# In[24]:


# S = input()


# In[25]:


# mylist = list(sorted(set(S)))
# abc = "abcdefghijklmnopqrstuvwxyz"
# for i in range(len(abc)):
#     if mylist[i] != abc[i]:
#         print(abc[i])
#         break
# else:
#     print("None")


# In[ ]:


s = input()
chars = set('abcdefghijklmnopqrstuvxwyz')
x = list(sorted(chars - set(s)))
if len(x):
    print(x[0])
else:
    print('None')
from operator import mul
from functools import reduce

def comb(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

N, K = map(int,input().split())
for i in range(1,K+1):
    c1 = comb(K-1,i-1)
    c2 = comb(N-K+1,i)
    print(int((c1*c2)%(1000000000+7)))



### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
Z = 2000

for i in range( 2, Z + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

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

for i in range(1,K+1):
    c1 = cmb(K-1,i-1,mod)
    c2 = cmb(N-K+1,i,mod)
    print(int((c1*c2)%(1000000000+7)))