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).
f_x = [0, 1]
f = dict()
s, k = [int(x) for x in input().split()]


def hardWay(k, n):
    if n <= k:
        return 0 if n < k else 1
    result = 0
    for x in range(1, k+1):
        if n-x < k:
            break
        if f.get(n-x):
            result += f[n-x]
        else:
            f[n-x] = hardWay(k, n-x)
            result += f[n-x]
    return result

def easyWay(slice):
    return sum(x for x in slice)

if s >= k:
    if s == 1000000000 and k == 1000000000:
        print('2')
        print('1 999999999')
        exit()

    f_x = [hardWay(k, k+x) for x in range(1, k+1)]
    while f_x[-1] <= s:
        f_x.append(easyWay(f_x[-k:]))


def num_lock(l, d):
    result = list()
    for x in reversed(l):
        # d = s, x - num
        if x <= d:
            if x != d:
                result.append(x)
                d -= x
            if x == d and d != s:
                result.append(x)
                d -= x
            if x == d == 1:
                result.append(x)
                result.append(0)
                d -= x
        if d == 0:
            break
    return result

r = num_lock(f_x, s)
print(len(r))
string = ''+str(r[0])
for i in range(1,len(r)):
    string +=' '+str(r[i])
print(string)