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

k=int(input())


def get(k):
    ans=7
    i=1
    while True:
        if ans%k==0:
            return i
        ans=(ans*10+7)%k
        i+=1




if k%2==0:
    print(-1)

else:
    print(get(k))



### FIXED CODE ###

k=int(input())


def get(k):
    ans=7
    i=1
    while True:
        if ans%k==0:
            return i
        ans=(ans*10+7)%k
        i+=1




if k%2==0 or k%5==0:
    print(-1)

else:
    print(get(k))
### BUGGY CODE ###

h,w = map(int,input().split())
a = [input() for _ in range(h)]

r1 = [1,0,0,-1]
r2 = [0,1,-1,0]
q = []
dis = [[-1]*w for _ in range(h)]
ans = 0

for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            q.append(((i, j), 0))
            dis[i][j] = 0

while q:
    p,d = q.pop(0)
    for i in range(4):
        r1i = r1[i]
        r2i = r2[i]
        if 0 <= p[0] + r1i < h and 0 <= p[1] + r2i < w:
            if dis[p[0]+r1i][p[1]+r2i] == -1 or dis[p[0]+r1i][p[1]+r2i] > dis[p[0]][p[1]] + 1:
                q.append(((p[0]+r1i,p[1]+r2i), dis[p[0]][p[1]] + 1))
                dis[p[0]+r1i][p[1]+r2i] = dis[p[0]][p[1]] + 1

for i in dis:
    ans = max(ans, max(i))

print(ans)


### FIXED CODE ###

import copy
#import time

h,w = map(int,input().split())
a = [input() for _ in range(h)]
b = [[False]*w for _ in range(h)]
#s = time.time()
c = []
d = [(-1,0), (1,0), (0,-1), (0,1)]
ans = 0

for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            b[i][j] = True
            c.append((i,j))
#print(time.time()-s)

while True:
    tmp = []
    cnt = 0
    for i,j in c:
        for d1,d2 in d:
            if 0 <= i + d1 < h and 0 <= j + d2 < w:
                if not b[i+d1][j+d2]:
                    tmp.append((i+d1, j+d2))
                    b[i+d1][j+d2] = True
                    cnt += 1
    #print(time.time()-s)
    if cnt > 0:
        c = copy.copy(tmp)
        ans += 1
    else:
        break
    #print(time.time()-s)

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

l,r=map(int,input().split())
if l-r>=673:
  print(0)
else:
  ans=float('inf')
  for i in range(l,r):
    for j in range(i+1,r+1):
      ans=min((i*j)%2019,ans)
  print(ans)


### FIXED CODE ###

l,r=map(int,input().split())
if abs(l-r)>=673:
  print(0)
else:
  ans=float('inf')
  for i in range(l,r):
    for j in range(i+1,r+1):
      ans=min((i*j)%2019,ans)
  print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
sum = 0
for i in range(N):
  i_diff = 0
  A1 = A[i]
  for j in range(i+1, N):
    i_diff += 1
    if (A[j] + A1) == i_diff:
      sum += 1
print(sum)

### FIXED CODE ###

from collections import defaultdict
 
N = int(input())	# 使わない
 
# j - i = A[i] + A[j] から、
# i + A[i] = j - A[j] となり、iとjが独立するため、同時並行で処理
L = defaultdict(lambda: 0)
R = defaultdict(lambda: 0)
for i, val in enumerate(map(int, input().split())):
  L[i - val] += 1	# i - val <= j - A[j]
  R[i + val] += 1	# i + val <= i + A[i]
  
cnt = 0
for key, val in L.items():
  if key > 0:
    cnt += L[key] * R[key]
    
print(cnt)
### BUGGY CODE ###

AV = input().split()
A,V = int(AV[0]), int(AV[1])
BW = input().split()
B,W = int(BW[0]), int(BW[1])
T = int(input())
while True:
    if A+V*T==B+W*T:
        print("YES")
    elif (A+V*T<B+W*T)or(A+V*T>B+W*T):
        print("NO")
    else:
        break

### FIXED CODE ###

a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
 
point_div = abs(a-b)
speed_div = v-w
if speed_div * t >= point_div:
    print("YES")
else:
    print("NO")
### BUGGY CODE ###

x = int(input())

# 素因数分解
def prime_factorization(n):
    prime = {}
    tmp = n
    for i in range(2, int(n**0.5)+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            if i in prime:
                prime[i] += cnt
            else:
                prime[i] = cnt
    if tmp != 1:
        if tmp in prime:
            prime[tmp] += 1
        else:
            prime[tmp] = 1
    return prime

if x == 1:
    print(0, -1)
else:
    p = prime_factorization(x)
    m = min(p.keys())
    a = 0
    while True:
        b = a - m
        if a ** 5 - b ** 5 == x:
            print(a, b)
            break
        a += 1


### FIXED CODE ###

x = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
### BUGGY CODE ###

mtx = [[0] * 2019 for _ in range(2019)]

for i in range(len(mtx)):
    for j in range(len(mtx)):
        mtx[i][j] = (i * j) % 2019

l, r = map(int, input().split())

min_val = 10000000

for i in range(l, r+1):
    for j in range(i+1, r+1):
        a = i % 2019
        b = j % 2019
        ret = mtx[a][b]
        min_val = min(min_val, ret)

print(min_val)


### FIXED CODE ###

mtx = [[0] * 2019 for _ in range(2019)]

for i in range(len(mtx)):
    for j in range(len(mtx)):
        mtx[i][j] = (i * j) % 2019

l, r = map(int, input().split())

min_val = 10000000

l_mod = l % 2019
r_mod = r % 2019

if r_mod < l_mod:
    r_mod += 2019

for i in range(l, r):
    for j in range(i+1 , r + 1):
        a = i % 2019
        b = j % 2019
        ret = mtx[a][b]
        min_val = min(min_val, ret)
        if min_val == 0:
            print(0)
            exit()

print(min_val)
### BUGGY CODE ###

import bisect
import sys
if __name__ == '__main__':
    input = sys.stdin.readline
    n = int(input())
    s = list(input())
    r = []
    g = []
    b = []

    for i in range(n):
        if s[i] == "R":
            r.append(i)
        elif s[i] == "G":
            g.append(i)
        else:
            b.append(i)
    x = len(b)
    ans = 0
    for i in range(n):
        for j in range(i, n):
            if s[i] == s[j]:
                continue
            if s[i] == "R" and s[j] == "G":
                out = j * 2 - i
                tmp = bisect.bisect_left(b, j)
                t = len(b) - tmp
                ans += (t - 1) if out in b[tmp:] else t

            elif s[i] == "R" and s[j] == "B":
                out = j * 2 - i
                tmp = bisect.bisect_left(g, j)
                t = len(g) - tmp
                ans += (t - 1) if out in g[tmp:] else t

            elif s[i] == "G" and s[j] == "B":
                out = j * 2 - i
                tmp = bisect.bisect_left(r, j)
                t = len(r) - tmp
                ans += (t - 1) if out in r[tmp:] else t

            elif s[i] == "G" and s[j] == "R":
                out = j * 2 - i
                tmp = bisect.bisect_left(b, j)
                t = len(b) - tmp
                ans += (t - 1) if out in b[tmp:] else t

            elif s[i] == "B" and s[j] == "R":
                out = j * 2 - i
                tmp = bisect.bisect_left(g, j)
                t = len(g) - tmp
                ans += (t - 1) if out in g[tmp:] else t

            elif s[i] == "B" and s[j] == "G":
                out = j * 2 - i
                tmp = bisect.bisect_left(r, j)
                t = len(r) - tmp
                ans += (t - 1) if out in r[tmp:] else t

    print(ans)


### FIXED CODE ###

import sys

if __name__ == '__main__':
    input = sys.stdin.readline
    n = int(input())
    s = list(input())
    s.remove('\n')
    r = 0
    g = 0
    b = 0
    for i in s:
        if i == "R":
            r += 1
        elif i == "G":
            g += 1
        else:
            b += 1
    ans = r * g * b
    for i in range(n):
        for j in range(i, n):
            out = j * 2 - i
            if out >= n:
                continue
            if len({s[i], s[j], s[out]}) == 3:
                ans -= 1
    print(ans)
### BUGGY CODE ###

n,k = map(int, input().split())
H = [0]+list(map(int, input().split()))
dp = [float("inf")]*(n+1)
dp[0] = 0
dp[1] = 0

for i in range(n):
  for k_i in range(1, k+1):
    if i+k_i<=n:
      dp[i+k_i] = min(dp[i+k_i], dp[i]+abs(H[i+k_i]-H[i]))
      
print(dp[-1])

### FIXED CODE ###

n,k = map(int, input().split())
H = [0]+list(map(int, input().split()))
dp = [float("inf")]*(n+1)
dp[0] = 0
dp[1] = 0

for i in range(1, n):
  for k_i in range(1, k+1):
    if i+k_i<=n:
      dp[i+k_i] = min(dp[i+k_i], dp[i]+abs(H[i+k_i]-H[i]))
      
print(dp[-1])
### BUGGY CODE ###

def main():
	H, W = map(int, input().split())
	S = [""]*H
	visit = [[False for _ in range(W)] for _ in range(H) ]
	for i in range(H):
		S[i] = input()

	stack = []
	for i in range(H):
		for j in range(W):
			stack.append([i, j])
			while stack:
				current = stack.pop()
				if S[current[0]][current[1]] == ".":
					continue

				if current[1] < W-1 and S[current[0]][current[1]+1] == "#":
					stack.append([current[0], current[1]+1])
					visit[current[0]][current[1]+1] = True
					visit[current[0]][current[1]] = True
				if current[0] < H-1 and S[current[0]+1][current[1]] == "#":
					stack.append([current[0]+1, current[1]])
					visit[current[0]+1][current[1]] = True
					visit[current[0]][current[1]] = True

	for i in range(H):
		for j in range(W):
			if S[i][j] == "#":
				if not visit[i][j]:
					print("No")
					return


	print("Yes")



if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
	H, W = map(int, input().split())
	S = [""]*H
	for i in range(H):
		S[i] = input()

	for i in range(H):
		for j in range(W):
			if S[i][j] == ".":
				continue
			if (
				(i > 0 and S[i-1][j] == "#")
				or (j > 0 and S[i][j-1] == "#")
				or (i < H-1 and S[i+1][j] == "#")
				or (j < W-1 and S[i][j+1] == "#")
				):
				continue
			print("No")
			return

	print("Yes")


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import math

N, K = map(int,input().split())
h = list(map(int,input().split()))
dp=[0]*N
for i in range(1,N):
  value=math.inf
  for j in range(1,K+1):
    if i-j<0:
      break
    value=min(value,dp[i-j]+abs(h[i]-h[i-j]))
  dp[i]=value
 
print(dp[N-1])

### FIXED CODE ###

from numba import jit
import math

N, K = map(int,input().split())
h = list(map(int,input().split()))
@jit
def nya(N, K, h):
  dp=[0]*N
  for i in range(1,N):
    value=math.inf
    for j in range(1,K+1):
      if i-j<0:
        break
      value=min(value,dp[i-j]+abs(h[i]-h[i-j]))
    dp[i]=value
  return(dp[N-1])
 
print(nya(N,K,h))
### BUGGY CODE ###

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

h = []
ans = 10**9

for i in range(N):
    h.append(int(input()))

h.sort()

for i in range(N-K+1):
    ans = min(max(h[i:i+K]) - min(h[i:i+K]), ans)


print(ans)

### FIXED CODE ###

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

h = []
ans = 10**9

for i in range(N):
    h.append(int(input()))

h.sort()

for i in range(N-K+1):
    ans = min(h[i+K-1]-h[i], ans)


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

#import sys

#input = sys.stdin.readline

import heapq

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    a = list(map(int,input().split()))
    b=[]
    for i in range(n):
        b.append([a[i],i+1])
#    print(b)
    heapq.heapify(b)
#    print(heapq.heappop(b))
#    print(b)
    #b=sorted(b,key=lambda x: x[1])
    c=""
 #   print(b)
    for i in range(n):
        d=heapq.heappop(b)
        d=d[1]
        c=c + str(d) + " "
    c.rstrip()
    print(c)

#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()

### FIXED CODE ###

#import sys

#input = sys.stdin.readline

import heapq

def main():
#    h,w,a,b = map(int, input().split())
    n=int(input())
    a = list(map(int,input().split()))
    b=[]
    for i in range(n):
        b.append([a[i],i+1])
#    print(b)
#    heapq.heapify(b)
#    print(heapq.heappop(b))
#    print(b)
    b=sorted(b,key=lambda x: x[0])
    for i in range(n):
        print(b[i][1], end=" ")


#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()
### BUGGY CODE ###

N = int(input())
F = 0
FF = 0
while(N>5):
  if(N>500):
    F = N/500
  else:
    FF = N/5
print((F*2)+(FF))

### FIXED CODE ###

N = int(input())
F=0
FF=0
FFF=0
FFFF = 0
if(N>=500):
    F=N/500
    FFF = int(F)
FFFF = (N-(500*FFF))
if(FFFF>5):
    FF=int(FFFF/5)
print((int(F)*1000)+FF*5)
### BUGGY CODE ###

import math
K=int(input())
s=0
for i in range(K):
    for j in range(K):
        for k in range(K):
            l=math.gcd(i+1,j+1)
            s=s+math.gcd(l,k+1)
print(s)


### FIXED CODE ###

K=int(input())+1

Ans=0
from math import gcd
for i in range(1,K):
    for j in range(1,K):
        tempA=gcd(i,j)
        for k in range(1,K):
            Ans+=gcd(tempA,k)
            
print(Ans)
### BUGGY CODE ###

import numpy as np
from collections import Counter as C

n=int(input())
a = list(input().split())
a = [int(i) for i in a]
q=int(input())
bc=[list(map(int,input().split())) for i in range(q)]
bc=np.array(bc).T
b=bc[0]
c=bc[1]

d=C(a)
d2={}
for k,v in d.items():
  d2[k]=k*v

#print(d)
for i in range(q):
  #print(d2)
  if d.get(b[i]):
    removed=d.pop(b[i])
    _=d2.pop(b[i])
    d[c[i]]+=removed
    d2[c[i]]=c[i]*d[c[i]]
  else:
    pass
  print(sum(d2.values()))
  


### FIXED CODE ###

import numpy as np
from collections import Counter as C

n=int(input())
a = list(input().split())
a = [int(i) for i in a]
q=int(input())
bc=[list(map(int,input().split())) for i in range(q)]
bc=np.array(bc).T
b=bc[0]
c=bc[1]

d=C(a)
d2={}
for k,v in d.items():
  d2[k]=k*v

#print(d)
ans=sum(a)
for i in range(q):
  d[c[i]]+=d[b[i]]
  ans+=(c[i]-b[i])*d[b[i]]
  d[b[i]]=0
  print(ans)
### BUGGY CODE ###

import math

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0:
      return False
  return True

q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    A = [i for i in range(l, r+1, 2)]
    B = [(a+1)//2 for a in A]
    cnt = 0
    for i in range(len(A)):
      if is_prime(A[i]) and is_prime(B[i]):
        cnt += 1
    print(cnt)

### FIXED CODE ###

import math
from itertools import accumulate

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0: return False
  return True

MAX = (10**5)+1
q = int(input())
A = [1 if is_prime(i)and is_prime((i + 1)//2) else 0 for i in range(MAX) ]
S = [0] + list(accumulate(A))

Q =[]
Q_append = Q.append
for _ in range(q):
    l, r = map(int, input().split())
    Q_append((l, r))

for qi in Q:  
    print(S[qi[1]+1]-S[qi[0]])
### BUGGY CODE ###

import fractions

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

x = fractions.gcd(A, B)

C = []

def cal(i):
    for j in range(2, i//2+1):
        while True:
            if i%j == 0:
                i //= j
                C.append(j)
            else:
                break
    if i != 1:
        C.append(i)
        
    return set(C)

print(1+len(cal(x)))

### FIXED CODE ###

import fractions

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

x = fractions.gcd(A, B)

C = []

def cal(i):
    for j in range(2, int(-(-i**0.5//1))+1):
        while True:
            if i%j == 0:
                i //= j
                C.append(j)
            else:
                break
    if i != 1:
        C.append(i)
        
    return set(C)

print(1+len(cal(x)))
### BUGGY CODE ###

import bisect
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N = int(input())
An = list(map(int,input().split(' ')))



An.sort()
max_num = An[N-1]

half_val = max_num//2
idx =  bisect.bisect_right(An[0:N-1],half_val)
if idx == 0:
    print(max_num,An[idx])
elif idx == N-1:
    print(max_num,An[idx-1])
else:
    A = combinations_count(max_num,An[idx-1])
    B = combinations_count(max_num,An[idx])
    if A > B:
        print(max_num,An[idx-1])
    else:
        print(max_num,An[idx])


### FIXED CODE ###

import bisect
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N = int(input())
An = list(map(int,input().split(' ')))


An.sort()
max_num = An[N-1]

half_val = max_num//2
idx =  bisect.bisect_right(An[0:N-1],half_val)
if idx == 0:
    print(max_num,An[idx])
elif idx == N-1:
    print(max_num,An[idx-1])
else:
    A = An[idx] - half_val
    B = half_val - An[idx-1]
    if A > B:
        print(max_num,An[idx-1])
    else:
        print(max_num,An[idx])
### BUGGY CODE ###


#MAX_N = 25; # nの最大値

#入力
n, W = map(int, input().split())
s = []
for i in range(n):#h:高さ
    s.append([int(m) for m in input().split()])
w = []
v = []
for i in range(n):
    w.append(s[i][0])
    v.append(s[i][1])
# DPテーブル
# dp[i][j]はi番目以降の品物から重さの和がj以下なるように選んだときの価値の和の最大値を表す。
dp = []
for i in range(n + 1):
    dp.append([])
for p in range(n + 1):
    for q in range(W + 1):
        dp[p].append(-1)

#iが大きくjが小さい順（使える品物と容量が少ない順）にメモの値が確定
#def solve_dp2():
for j in range(W + 1):
    dp[n][j] = 0
for i in range(n - 1, -1, -1):
    for j in range(W + 1):
      if j < w[i]:
        dp[i][j] = dp[i + 1][j]
      else:
        dp[i][j] = max(dp[i + 1][j], dp[i + 1][j - w[i]] + v[i])

print(dp[0][W])


### FIXED CODE ###

#入力
n, W = map(int, input().split())
s = []
for i in range(n):#h:高さ
    s.append([int(m) for m in input().split()])
s.sort(key=lambda x:(x[0], x[1]))
s0 = []
s1 = []
s2 = []
s3 = []
for i in range(n):
    if i == 0:
        w0 = s[i][0]
        s0.append(s[i])
    elif s[i][0] == w0:
        s0.append(s[i])
    elif s[i][0] == w0 + 1:
        s1.append(s[i])
    elif s[i][0] == w0 + 2:
        s2.append(s[i])
    elif s[i][0] == w0 + 3:
        s3.append(s[i])
s0.sort(key=lambda x: x[1], reverse=True)
s1.sort(key=lambda x: x[1], reverse=True)
s2.sort(key=lambda x: x[1], reverse=True)
s3.sort(key=lambda x: x[1], reverse=True)
w = []
v = []
t0 = 0
t1 = 0
t2 = 0
t3 = 0
u0 = 0
u1 = 0
u2 = 0
u3 = 0
u = []
for h in range(-1, len(s0)):
    if h == -1:
        t0 = 0
        u0 = 0
    else:
        t0 += s0[h][0]
        u0 += s0[h][1]
    for i in range(-1, len(s1)):
        if i == -1:
            t1 = 0
            u1 = 0
        else:
            t1 += s1[i][0]
            u1 += s1[i][1]
        for j in range(-1, len(s2)):
            if j == -1:
                t2 = 0
                u2 = 0
            else:
                t2 += s2[j][0]
                u2 += s2[j][1]
            for k in range(-1, len(s3)):
                if k == -1:
                    t3 = 0
                    u3 = 0
                else:
                    t3 += s3[k][0]
                    u3 += s3[k][1]
                if t0 + t1 + t2 + t3 <= W:
                    u.append(u0 + u1 + u2 + u3)
print(max(u))
### BUGGY CODE ###

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

dp = [0] * (n+5)
dp[0] = 1
for i in range(n):
    dp[i] %= 1000000007
    if i+1 not in a:
        dp[i+1] += dp[i]
    if i+2 not in a:
        dp[i+2] += dp[i]
print(dp[n] % 1000000007)

### FIXED CODE ###

n, m = map(int, input().split())
a = set()
for _ in range(m):
    a.add(int(input()))

dp = [0] * (n+5)
dp[0] = 1
for i in range(n):
    dp[i] %= 1000000007
    if i+1 not in a:
        dp[i+1] += dp[i]
    if i+2 not in a:
        dp[i+2] += dp[i]
print(dp[n] % 1000000007)
### BUGGY CODE ###

import math
ans = 0
num = int(input())
for i in range(1, num+1):
    for j in range(1, num+1):
        for k in range(1, num+1):
            ans += math.gcd(math.gcd(i, j),k)
print(ans)

### FIXED CODE ###

import math
ans = 0
num = int(input())
for i in range(1, num+1):
    for j in range(1, num+1):
        for k in range(1, num+1):
            ans += math.gcd(math.gcd(i, j),k)
print(ans)
### BUGGY CODE ###

def factors(n):
    sieve = [1]*(n+10)
    m = 1
    while m*7-1 <= n:
        for p in [m*7-1,m*7+1]:
            if sieve[p] == 0: continue
            for pp in range(2*p,n+1,p):
                sieve[pp] = 0
        m += 1
    ret = []
    m = 1
    while m*7-1 <= n:
        for p in [m*7-1,m*7+1]:
            if sieve[p] and n % p == 0:
                ret.append(p)
        m += 1
    return(ret)

while True:
    N = int(input())
    if N == 1: break
    ans = ' '.join(list(map(str,factors(N))))
    print('{0}: {1}'.format(N,ans))

### FIXED CODE ###

MAXN = 300010
sieve = [1]* MAXN
primes = []
for n in range(7,MAXN,7):
    for m in [n-1,n+1]:
        if sieve[m] == 0: continue
        primes.append(m)
        for l in range(2*m,MAXN,m):
            sieve[l] = 0

def solve(n):
    ret = []
    for p in primes:
        if p > n: break
        if n%p == 0:
            ret.append(p)
    return ret

while True:
    N = int(input())
    if N == 1: break
    ans = ' '.join(list(map(str,solve(N))))
    print('{0}: {1}'.format(N,ans))
### BUGGY CODE ###

A, B, C, D, E, F = map(int, input().split())
a, b = [], []

for i in range(31):
    for j in range(31):
        v = 100*A*i+100*B*j
        if v < F:
            a.append(v)
        else:
            break

for i in range(3000//C+2):
    for j in range(3000//D+2):
        v = C*i+D*j
        if v < F:
            b.append(v)
        else:
            break

a.sort()
b.sort()

c = 0
ans = [0, 0]
for ai in a:
    for bi in b:
        t = ai+bi
        if t > 0 and t <= F and (E*ai//100) >= bi:
            tc = 100*bi/(ai+bi)
            if c < tc:
                c = tc
                ans = [t, bi]
if c == 0:
    while True:
        c = 0
print(*ans)


### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
a, b = [], []

for i in range(3001):
    for j in range(3001):
        v = 100*A*i+100*B*j
        if v <= F:
            a.append(v)
        else:
            break

for i in range(3001):
    for j in range(3001):
        v = C*i+D*j
        if v <= F:
            b.append(v)
        else:
            break

a.sort()
b.sort()

c = -1
ans = [0, 0]
for ai in a:
    for bi in b:
        t = ai+bi
        if t > 0 and t <= F and (E*ai//100) >= bi:
            tc = 100*bi/(ai+bi)
            if c < tc:
                c = tc
                ans = [t, bi]

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

n, k = [int(e) for e in input().split()]
cache = {}
def memoize(f):
    global cache
    def _(*args):
        if not args in cache:
            cache[args] = f(*args)
        return cache[args]
    return _
@memoize
def f(n, x):
  if x == 1:
    return 1
  else:
    return sum(f(i, x - 1) for i in range(n + 1))
for i in range(1, k + 1):
  print(f(k - i, i) * f(n - k - i + 1, i + 1) % (10 ** 9 + 7))

### FIXED CODE ###

def main():
    N, K = map(int, input().split())

    c = [[0] * 4000 for _ in range(4000)]
    c[0][0] = 1
    for i in range(1, 4000):
        ci = c[i]
        ci1 = c[i - 1]
        ci[0] = 1
        for j in range(1, i + 1):
            ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007

    def f(n, k):
        return c[n+k-1][k-1]

    for i in range(1, K + 1):
        print((f(K-i, i) * f(N-K-(i-1), i+1)) % 1000000007)


main()