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).
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
 
# M = mod = 998244353
# def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
# def inv_mod(n):return pow(n, mod - 2, mod)
 
def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n').split(' ')]
def li3():return [int(i) for i in input().rstrip('\n')]


def func(l,i,tot,req,currlist):
    if i==len(l):
        if tot == req:
            print(len(currlist))
            print(*currlist)
            exit()
    else:
        func(l,i+1,tot + l[i],req,currlist[:] + [l[i]])
        func(l,i+1,tot,req,currlist[:])



l = [0,1,1,2]
currsum = sum(l)
s,k = li()
while l[-1] <= s:
    l.append(currsum)
    currsum*=2
func(l,0,0,s,[])