Numbers *k*-bonacci (*k* is integer, *k* &gt; 1) are a generalization of Fibonacci numbers and are determined as follows:
 -  *F*(*k*, *n*) = 0, for integer *n*, 1 ≤ *n* &lt; *k*; -  *F*(*k*, *k*) = 1; -  *F*(*k*, *n*) = *F*(*k*, *n* - 1) + *F*(*k*, *n* - 2) + ... + *F*(*k*, *n* - *k*), for integer *n*, *n* &gt; *k*. 
Note that we determine the *k*-bonacci numbers, *F*(*k*, *n*), only for integer values of *n* and *k*.

You've got a number *s*, represent it as a sum of several (at least two) distinct *k*-bonacci numbers.
The first line contains two integers *s* and *k* (1 ≤ *s*, *k* ≤ 10<sup class="upper-index">9</sup>; *k* &gt; 1).
def genkbon (s, k):
    res = [0]
    i = 0
    while (res[i]<=s):
        if (i<k):
            res.append(0)
        elif (i==k):
            res.append(1)
        elif (i==k+1):
            res.append(1)
        else:
            res.append(2*res[i]-res[i-k])
        i += 1
    del res[-1]
    return res
    
def solve(s, k):
    if (s==0):
        return [0]
    if (s==1):
        return [0,1]
    if (s==2):
        return [0,2]
    tmp = genkbon (s, k)
    ha = tmp[-1]
    res = solve(s-ha,k)
    return [ha]+res
    
inp1 = input()
inp = inp1.split()
sol = solve(int(inp[0]),int(inp[1]))
print(len(sol))
for i in sol[:-1]:
    print(i,end=' ')
print(sol[-1])