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

S = list(input())
len_size = len(S)

queue = []
cnt = 0

for i in range(len_size):

	# キューの更新
	for j in range(len(queue)):
		queue[j] += S[i]

		# 2019で割れるかチェック
		tmp_val = int(queue[j])
		if(tmp_val % 2019 == 0):
			cnt += 1
			queue[j] = ""

	queue.append(S[i])	

print(cnt)

### FIXED CODE ###

M = 2019

S = list(input())
s_size = len(S)

S.reverse()
x = 1
tot = 0
ans = 0

cnt_list = [0 for i in range(M)]

for i in range(s_size):
	cnt_list[tot] += 1
	tot += (ord(S[i])-ord('0'))*x
	tot %= M
	ans += cnt_list[tot]
	x = x*10%M

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

#!/usr/bin/env python3
s = input()
n = len(s)
cs = [0] * (n + 1)
for i, x in enumerate(s):
    cs[i + 1] = cs[i] + int(x)
ans = 0
for i in range(n):
    for j in range(i + 3, n + 1):
        if (cs[j] - cs[i]) % 3 != 0:
            continue
        k = int(s[i:j])
        if k % 2019 == 0:
            ans += 1
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
s = input()[::-1]
n = len(s)
cs = [0] * (n + 1)
ten = 1
for i in range(n):
    cs[i + 1] = int(s[i]) * ten % 2019
    ten = ten * 10 % 2019
for i in range(n):
    cs[i + 1] = (cs[i + 1] + cs[i]) % 2019
cnt = [0] * 2019
for i, x in enumerate(cs):
    cnt[x] += 1
ans = sum(x * (x - 1) // 2 for x in cnt)
print(ans)
### BUGGY CODE ###

k = int(input())
i = 1
a = 7
if k % 2 == 0:
  print("-1")
else:
  while a % k != 0:
    i += 1
    a = 10*a + 7
    if i == 10**9+7:
      i = -1
      break

  print(i)
  


### FIXED CODE ###

k = int(input())
i = 1
a = 7
a = a % k
while a != 0:
  i += 1
  a = (10*a + 7) % k
  if i == 10**6:
    i = -1
    break

print(i)
### BUGGY CODE ###

import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

s = ns()[::-1]
b = [0]
for i in range(1,len(s)+1):
    b.append(int(s[:i][::-1])%2019)

import collections

c = collections.Counter(b)
ans = 0

for j in c.values():
    if j > 1:
        ans += j*(j-1)//2

print(ans)

### FIXED CODE ###

import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

from collections import defaultdict

s = ns()
d = defaultdict(int)
d[0] += 1
k = 1
n = 0
for i in range(len(s))[::-1]:
    n += int(s[i])*k%2019
    n%=2019
    d[n] += 1
    k = (k*10)%2019

ans = 0

for j in d.values():
    if j > 1:
        ans += j*(j-1)//2

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

import itertools

N = int(input())
L = list(map(int, input().split()))
L = sorted(L, reverse=True)

counter = 0

for i in range(0, N-2):
    temp = L[i]
    other = list(itertools.combinations(L[i+1:], 2))
    for j in range(len(other)):
        if temp < other[j][0] + other[j][1] and other[j][0] < temp + other[j][1] and other[j][1] < temp + other[j][0]:
            counter += 1

print(counter)

### FIXED CODE ###

n = int(input())
nums = list(map(int, input().split(' ')))
nums.sort()
total = 0

for i in range(n-1, -1, -1):
    l = 0
    r = i - 1
    while l < r:
        if nums[l] + nums[r] > nums[i]:
            total += r - l
            r -= 1
        else:
            l += 1
print(total)
### BUGGY CODE ###

a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
for i in range(int(b/a), e):
  if ans < (int(a*i/b)-a*int(i/b)):
    ans = int(a*i/b)-a*int(i/b)
print(ans)

### FIXED CODE ###

a, b, n = map(int, input().split())
ans = 0
e = min(n+1,b)
s = max(int(b/a),e-1000)
for i in range(s, e):
  x = (int(a*i/b)-a*int(i/b))
  if ans < x:
    ans = x
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
#import numpy as np
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())

S = str(input())
Q = int(input())
#query = [["" for _ in range(3)] for _ in range(Q)]

for _ in range(Q) :
  stmp = input().split()
  #print (stmp)
  if stmp[0] == "1" :
    S = S[::-1]
  else :
    if stmp[1] == '1' :
      S = stmp[2] + S
    else :
      S = S + stmp[2]

print (S)




### FIXED CODE ###

# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
#import numpy as np
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())

S = str(input())
Q = int(input())
#query = [["" for _ in range(3)] for _ in range(Q)]

sl = [] #先頭リスト
el = [] #末尾リスト
f = True #反転正負
for _ in range(Q) :
  stmp = input().split()
  #print (stmp)
  
  if stmp[0] == "1" :
    f = not f
    tl = sl
    sl = el
    el = tl
    
  else :
    if stmp[1] == '1' :
      sl.append(stmp[2])
    else :
      el.append(stmp[2])

ans = ""
for i in range(len(sl)-1, -1, -1) :
  ans += sl[i]
if f :
  ans += S
else :
  ans += S[::-1]
for i in range(len(el)) :
  ans += el[i]
  
print (ans)
### BUGGY CODE ###

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int,input().split())))
max = 0
for xy1 in xy:
  for xy2 in xy:
    dis = abs(xy1[0]-xy2[0]) + abs(xy1[1]-xy2[1])
    if dis > max:
      max = dis
print(max)

### FIXED CODE ###

n = int(input())
xy = []
for _ in range(n):
    xy.append(list(map(int,input().split())))
a,b=xy[0]
m1=a+b
p1=xy[0]
m2=a-b
p2=xy[0]
p3=xy[0]
p4=xy[0]
m3=-a-b
m4=-a+b

for x,y in xy:
    if x+y > m1:
        m1=x+y
        p1 = [x,y]
    if x-y > m2:
        m2=x-y
        p2 = [x,y]
    if -x-y > m3:
        m3 = -x-y
        p3 = [x,y]
    if -x+y > m4:
        m4 = -x+y
        p4 = [x,y]
m = 0
for x0,y0 in [p1,p2,p3,p4]:
    for x1,y1 in [p1,p2,p3,p4]:
        dis=abs(x0-x1) + abs(y0-y1)
        if dis > m:
            m = dis
print(m)
### BUGGY CODE ###

N = int(input())
S = {}
for i in range(N):
    s = input()
    if not(s[0] in S.keys()):
        S[s[0]] = [s]
    elif not(s in S[s[0]]):
        S[s[0]].append(s)

ans = 0
for i in S.values():
    ans += len(i)

print(ans)


### FIXED CODE ###

from collections import Counter

N = int(input())
S = []
for i in range(N):
    S.append(input())

cnt = Counter(S)


print(len(cnt.keys()))
### BUGGY CODE ###

A, B, K = map(int, input().split(' '))

tmp_list = [i for i in range(A, B + 1)]

if (B - A + 1) / 2 < K:
    print('\n'.join(str(i)for i in tmp_list))
else:
    for i in tmp_list[0 : K]:
        print(i)
    for i in tmp_list[len(tmp_list) - K:]:
        print(i)


### FIXED CODE ###

A, B, K = map(int, input().split(' '))

if (B - A + 1) / 2 < K:
    for i in range(A, B + 1):
        print(i)
else:
    for i in range(A, A + K):
        print(i)
    for i in range(B - K + 1, B + 1):
        print(i)
### BUGGY CODE ###

from collections import Counter

n, k = map(int, input().split())
a = list(map(int, input().split()))
b = 0
for t in range(n):
    if len(set(a)) <= k:
        print(b)
        break
    else:
        c = Counter(a)
        d = min(c, key=c.get)
        e = max(c, key=c.get)
        a = [e if i == d else i for i in a]
        b = b + c[d]


### FIXED CODE ###

from collections import Counter

n, k = map(int, input().split())
a = list(map(int, input().split()))
if len(set(a)) <= k:
    print(0)
else:
    b = Counter(a)
    t = len(set(a)) - k
    c = b.most_common()[:-t-1:-1]
    d = 0
    for e in c:
        d = d + e[1]
    print(d)
### BUGGY CODE ###

s = input()
q = int(input())
ls = [input().split() for _ in range(q)]

for i in range(q):
    if ls[i][0] == '1':
        s = s[::-1]
    elif ls[i][0] == '2':
        if ls[i][1] == '1':
            s = ls[i][2] + s
        elif ls[i][1] == '2':
            s = s + ls[i][2]
    
print(s)

### FIXED CODE ###

from collections import deque

s = input()
q = int(input())
ls = [input().split() for _ in range(q)]

ans = deque(s)
cnt = 0

for t in ls:
    if t[0] == '1':
        cnt += 1
    elif t[0] == '2':
        if cnt % 2 == 0:
            if t[1] == '1':
                ans.appendleft(t[2])
            elif t[1] == '2':
                ans.append(t[2])
        elif cnt % 2 == 1:
            if t[1] == '1':
                ans.append(t[2])
            elif t[1] == '2':
                ans.appendleft(t[2])

if cnt % 2 == 0:
    print("".join(ans))
elif cnt % 2 == 1:
    ans.reverse()
    print("".join(ans))
### BUGGY CODE ###

N = int(input())
a = list(map(int,(input().split())))
for i in range(1,N+1):
  if i not in a:
    print(0)
  else:
    print(a.count(i))

### FIXED CODE ###

N = int(input())
a = list(map(int,(input().split())))
list_a = [0]*2*100001
for i in a:
  list_a[i] += 1
for i in range(1,N+1):
  print(list_a[i])
### BUGGY CODE ###

N=int(input())
data=list(map(int,input().split()))
s=1
if 0 in data:
    print(0)
else:
    for f in data:
        s *= f
    if s > 10**18:
        print(-1)
    else:
        print(s)

### FIXED CODE ###

N=int(input())
data=list(map(int,input().split()))
if 0 in data:
    print(0)
else:
    s=1
    for f in data:
        s *= f
        if s > 10**18:
            break
    if s > 10**18:
        print(-1)
    else:
        print(s)
### BUGGY CODE ###

def main():
    N, M = list(map(int, input().split()))
    if N % 2 == 1:
        for i in range(M):
            print(i + 1, N - i - 1)
            
    else:
        A = [False] * N
        t = 0
        for i in range(M):
            while True:
                while A[t%N]:
                    t += 1
                A[t%N] = True
                if A[(t + i + 1)% N]:
                    A[t%N] = False
                    t += 1
                    continue
                break
            A[(t + i + 1) % N] = True
            print(t%N + 1, (t + i + 1)%N + 1)

main()


### FIXED CODE ###

def main():
    N, M = list(map(int, input().split()))
    if N % 2 == 1:
        for i in range(M):
            print(i + 1, N - i - 1)
            
    else:
        s = set()
        t = 0
        for i in range(M):
            a, b = i + 1, N - i - t
            if (b - a) in s or (a + N - b) in s or b - a == a + N - b:
                t += 1
                b = N - i - t
            print(a, b)
            s.add(b - a)
            s.add(N + a - b)

main()
### BUGGY CODE ###

#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

"""
dp
time / books_no?
10 0 0
20 0 0
30 0 0
40 0 0
50 0 0
60 1 0
70 1 0
80 0 1




"""



N, M, K = LI()
A = LI()
B = LI()

"""
片方に注目して探索すればよい　

単純にfor,forだと計算量がまずいが，前回の値の部分から探索すればいいのでそこまで
計算量は増えない

"""

a = [0]
b = [0]

for i in range(N):
    a.append(a[-1] + A[i])

for i in range(M):
    b.append(b[-1] + B[i])

# print(a)
ans = 0
best = mod
for i in range(N + 1):
    if a[i] > K:
        break
    for j in range(min(best + 1, M + 1)):
        if a[i] + b[j] > K:
            break
        ans = max(ans, i + j)
        best = j
print(ans)
    

### FIXED CODE ###

#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

"""
dp
time / books_no?
10 0 0
20 0 0
30 0 0
40 0 0
50 0 0
60 1 0
70 1 0
80 0 1




"""



N, M, K = LI()
A = LI()
B = LI()

"""
片方に注目して探索すればよい　

単純にfor,forだと計算量がまずいが，前回の値の部分から探索すればいいのでそこまで
計算量は増えない

"""

a = [0]
b = [0]

for i in range(N):
    a.append(a[-1] + A[i])

for i in range(M):
    b.append(b[-1] + B[i])

# print(a)
ans = 0
j = M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
### BUGGY CODE ###

N = int(input())
lsa = list(map(str,input().split()))
lsb = []
if N%2 == 0:
    for i in range(N):    
        if i % 2 == 0:
            lsb.append(lsa[i])
        else:
            lsb = [lsa[i]] + lsb
if N%2 == 1:
    for i in range(N):
        if i % 2 == 1:
            lsb.append(lsa[i])
        else:
            lsb = [lsa[i]] + lsb

print(' '.join(lsb))

### FIXED CODE ###

import collections
N = int(input())
lsa = list(map(str,input().split()))
lsb = collections.deque()
if N%2 == 0:
    for i in range(N):    
        if i % 2 == 0:
            lsb.append(lsa[i])
        else:
            lsb.appendleft(lsa[i])
if N%2 == 1:
    for i in range(N):
        if i % 2 == 1:
            lsb.append(lsa[i])
        else:
            lsb.appendleft(lsa[i])

print(' '.join(lsb))
### BUGGY CODE ###

N = int(input())
S = list(input())
S_set = set()
i_set = set()

ans_list = {}


for i in range(N):
    if i in i_set:
        continue
    i_set.add(S[i])
    for j in range(i+1, N):
        if not S[j + 1:N] or S[i] + S[j] in S_set:
            continue
        ans_list[S[i] + S[j]] = S[j + 1:N]
        S_set.add(S[i] + S[j])
count = 0
# print(ans_list)
ans_len_list = [len(set(value)) for value in ans_list.values()]
print(sum(ans_len_list))

### FIXED CODE ###

N = int(input())
S = list(input())
visited = {}

count = 0

for i, s in enumerate(S):
    if s in visited:
        continue
    visited[s] = []
    for j, s2 in enumerate(S[i+1:N-1]):
        # print(s, s2, S[i + j + 2:N])
        if s2 in visited[s]:
            continue
        count += len(set(S[i + j + 2:N]))
        visited[s].append(s2)
        # print(s, s2, set(S[j + 1:N]))
print(count)
### BUGGY CODE ###

n = int(input())
ans = 0
for i in range(1, n):
    for j in range(1,n-i+1):
        if (n - i) % j == 0:
            ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0
for a in range(1, n):
    ans += (n - 1) // a
print(ans)
### BUGGY CODE ###


n = int(input())
l1 = l2 = l3 = 0
l = [int(i) for i in input().split()]
for i in l:
    if i == 1:
        l1 += 1
    elif i == 2:
        l2 += 1
    else:
        l3 += 1
a = l2+l3
dp = [[[0]*(l3+1) for i in range(a+1)] for j in range(n+1)]

for i in range(1,n+1):
    for j in range(min(i,a)+1):
        for k in range(min(j,l3)+1):
            s = i-j
            t = j-k
            count = n/(s+t+k)
            if s > 0:
                count += dp[s-1][t][k]*(s/(s+t+k))     
            if t > 0 :
                count += dp[s+1][t-1][k]*(t/(s+t+k))
            if k > 0 :
                count += dp[s][t+1][k-1]*(k/(s+t+k))

            dp[s][t][k] = count

print(dp[l1][l2][l3])




### FIXED CODE ###

N=int(input())
A=[int(i) for i in input().split()]
I,J,K=0,0,0
for a in A:
    if a==1:
        I+=1
    if a==2:
        J+=1
    if a==3:
        K+=1
L=I+J+K
M=J+K
dp=[[[0.0]*(K+1) for i in range(M+1)] for i in range(L+1)]
for n in range(1,L+1):#n=i+j+k
    for m in range(min(n,M)+1):#m=j+k
        for k in range(min(m,K)+1):
            j=m-k
            i=n-m
            #print(i,j,k)
            ret=N/(i+j+k)
            if i>0:
                ret+=dp[i-1][j][k]*(i/(i+j+k))
            if j>0:
                ret+=dp[i+1][j-1][k]*(j/(i+j+k))
            if k>0:
                ret+=dp[i][j+1][k-1]*(k/(i+j+k))
            dp[i][j][k]=ret
print(dp[I][J][K])
### BUGGY CODE ###

from collections import deque
n,m,k = map(int,input().split()) 
g = [set() for _ in range(n)]
bl = [set() for _ in range(n)]

for _ in range(m):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    g[a].add(b)
    g[b].add(a)

for _ in range(k):
    c,d = map(int,input().split())
    c,d = c-1,d-1
    bl[c].add(d)
    bl[d].add(c)

ans = [0]*n 

def bfs():
    for u in range(n):
        q = deque([u])
        d = [False]*n
        d[u] = True
        l = {u}
        while q:
            v = q.popleft()
            for i in g[v]:
                if d[i] == False:
                    l.add(i)
                    d[i] = True
                    q.append(i)
        for p in l:
            ans[p] = len(l) - len(l&g[p]) - len(l&bl[p]) - 1
    
bfs()

print(*ans)

### FIXED CODE ###

n,m,k = map(int,input().split())
par = [-1]*(n+1)
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]
def same(x,y):
    return find(x) == find(y)
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    else:
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
def size(x):
    return -par[find(x)]
g = [[] for _ in range(n+1)]
b = [[] for _ in range(n+1)]
for _ in range(m):
    s,t = map(int,input().split())
    unite(s,t)
    g[s].append(t)
    g[t].append(s)
for _ in range(k):
    s,t = map(int,input().split())
    b[s].append(t)
    b[t].append(s)
for i in range(1,n+1):
    ans = size(i)-1-len(g[i])
    for e in b[i]:
        if same(i,e):
            ans -= 1
    print(ans,end=" ")
### BUGGY CODE ###

import itertools
import numpy as np

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

combi = list(itertools.combinations(A, 2))

ans = 0
for i in combi:
    ans +=i[0]*i[1]

print(np.mod(ans,10**9+7))


### FIXED CODE ###

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

k = 1000000007

sm = sum(A)

ans = 0
for s in range(len(A)-1):
    #ans += A[s]*sum(A[s+1:])
    sm -= A[s]
    ans += A[s]*sm

if ans>1000000007:
    print(ans%k)
else:
    print(ans)
### BUGGY CODE ###

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)

divisible = [False for _ in range(int(1e6+1))]
cnt = defaultdict(int)

for a in A:
    cnt[a] += 1
    if divisible[a] == False:
        for i in range(a+a, len(divisible), a):
            divisible[i] = True
ans = 0
for a in A:
    if divisible[a] is False and cnt[a] <= 1:
        ans += 1
print(ans)


### FIXED CODE ###

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)

divisible = [False for _ in range(int(1e6+1))]
cnt = defaultdict(int)

for a in A:
    cnt[a] += 1
    if divisible[a] == False and cnt[a] <= 1:
        for i in range(a+a, len(divisible), a):
            divisible[i] = True
ans = 0
for a in A:
    if divisible[a] is False and cnt[a] <= 1:
        ans += 1
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
h,w = map(int,input().split())
s = [[j for j in input()] for i in range(h)]
d_2y = [[0] * w for i in range(h)]
d_2t = [[0] * w for i in range(h)]
d_2w = [[0] * w for i in range(h)]
for i in range(h):
  c = 0
  for j in range(w):
    if s[i][j] == '#':
      c = 0
    else:
      c += 1
    d_2y[i][j] = c
for i in range(h):
  for j in range(w-2,-1,-1):
    if s[i][j] == '#':
      continue
    else:
      d_2y[i][j] = max(d_2y[i][j+1],d_2y[i][j])
for i in range(w):
  c = 0
  for j in range(h):
    if s[j][i] == '#':
      c = 0
    else:
      c += 1
    d_2t[j][i] = c
for i in range(w):
  for j in range(h-2,-1,-1):
    if s[j][i] == '#':
      d_2t[j][i] = 0
    else:
      d_2t[j][i] = max(d_2t[j][i],d_2t[j+1][i])
m = 0
for i in range(h):
  for j in range(w):
    d_2w[i][j] = d_2y[i][j] + d_2t[i][j]
  m = max(m,max(d_2w[i]))
print(m-1)

### FIXED CODE ###

import sys
input = sys.stdin.readline
h,w = map(int,input().split())
s = [[j for j in input()] for i in range(h)]
d_2y = [[0] * w for i in range(h)]
d_2t = [[0] * w for i in range(h)]
d_2w = [[0] * w for i in range(h)]
for i in range(h):
  c = 0
  for j in range(w):
    if s[i][j] == '#':
      c = 0
    else:
      c += 1
    d_2y[i][j] = c
for i in range(h):
  for j in range(w-2,-1,-1):
    if s[i][j] == '#':
      continue
    else:
      d_2y[i][j] = max(d_2y[i][j+1],d_2y[i][j])
for i in range(w):
  c = 0
  for j in range(h):
    if s[j][i] == '#':
      c = 0
    else:
      c += 1
    d_2t[j][i] = c
for i in range(w):
  for j in range(h-2,-1,-1):
    if s[j][i] == '#':
      d_2t[j][i] = 0
    else:
      d_2t[j][i] = max(d_2t[j][i],d_2t[j+1][i])
m = 0
for i in range(h):
  for j in range(w):
    d_2w[i][j] = d_2y[i][j] + d_2t[i][j]
  m = max(m,max(d_2w[i]))
print(m-1)
### BUGGY CODE ###

n,k = map(int,input().split())
mod = 10**9 + 7

def comb(n,k):
    nCk = 1
    MOD = 10**9+7

    for i in range(n-k+1, n+1):
        nCk *= i
        nCk %= MOD

    for i in range(1,k+1):
        nCk *= pow(i,MOD-2,MOD)
        nCk %= MOD
    return nCk
  
for i in range(1,k+1):
  a = comb(k-1,i-1)%mod
  b = comb(n-k+1,i)%mod
  print(a*b%mod)

### FIXED CODE ###

n,k = map(int,input().split())
mod = 10**9 + 7

def comb(n,k):
    nCk = 1
    MOD = 10**9+7

    for i in range(n-k+1, n+1):
        nCk *= i
        nCk %= MOD

    for i in range(1,k+1):
        nCk *= pow(i,MOD-2,MOD)
        nCk %= MOD
    return nCk
  
for i in range(1,k+1):
  a = comb(k-1,i-1)%mod
  b = comb(n-k+1,i)%mod
  print(a*b%mod)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int

def get_z(y, x):
    while y % x > 0:
        y += MOD
    return y // x

def simplify(y, x):
    ret = 1
    while y % (1 << ret) == 0:
        ret += 1
    return (y >> (ret - 1), x >> (ret - 1))

def comb(n, k):
    if n < k:
        return 0
    k = min(k, n - k)
    ret = 1
    for i in range(k):
        ret *= (n - i)
        ret //= (i + 1)
    return ret

def solve(b: int, w: int):
    n = b + w
    bb = 0
    ww = 0
    for i in range(1, n + 1):
        par = 1 << (i - 1)
        other = par - bb - ww
        x = par << 1
        y = other + bb * 2
        #print("bb : %d, ww : %d, other : %d" % (bb, ww, other))
        #print(y, ' / ', x)
        ret = get_z(y, x)
        print(ret)
        bb = bb * 2 + comb(i - 1, w - 1)
        ww = ww * 2 + comb(i - 1, b - 1)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    B = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    solve(B, W)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int

def get_z(y, x): # y/x (mod 1000000007)
    inv_x = pow(x, MOD - 2, MOD)
    return y * inv_x % MOD

def _get_z(y, x): # y / x
    #inv_x = pow(x, MOD - 2, MOD)
    #return y * inv_x % MOD
    while y % x > 0:
        y += MOD
    return y // x

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

def reduce(y, x):
    tmp = gcd(x, y)
    return (y // tmp, x // tmp)

def make_comb(n, k):
    fact = [1] * (n + 1)
    for i in range(2, n + 1):
        fact[i] = (fact[i - 1] * i) % MOD

    ret = [0] * (n + 1)
    for i in range(k, n + 1):
        a = fact[i]
        b = (fact[k] * fact[i - k]) % MOD
        ret[i] = get_z(a, b)
    return ret

def _make_comb(n, k):
    ret = [0] * n
    ret[k] = 1
    for i in range(k + 1, n):
        ret[i] = (ret[i - 1] * i) // (i - k)
        ret[i] %= MOD
    return ret

def solve(b: int, w: int):
    n = b + w
    bb = 0
    ww = 0
    b_comb = make_comb(n, b - 1)
    w_comb = make_comb(n, w - 1)
    par = 1
    for i in range(1, n + 1):
        #print(' ======== i: %d ==============' % i)
        other = par - bb - ww
        x = (par * 2) % MOD
        y = (other + bb * 2) % MOD
        #x = (par * 2)
        #y = other + bb * 2
        #print("bb : %d, ww : %d, other : %d" % (bb, ww, other))
        #print(y, ' / ', x)
        #y, x = reduce(y, x)
        ret = get_z(y, x)
        print(ret)
        #bb = (bb * 2 + w_comb[i - 1])
        #ww = (ww * 2 + b_comb[i - 1])
        #par = (par * 2)
        bb = (bb * 2 + w_comb[i - 1]) % MOD
        ww = (ww * 2 + b_comb[i - 1]) % MOD
        par = (par * 2) % MOD
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    B = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    solve(B, W)

if __name__ == '__main__':
    main()