import io, os
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
def binarySearch(arr,l,r,val):
    while l<=r:
        mid=(l+r)//2
        if arr[mid]==val:
            ans=mid
            break
        elif arr[mid]<val:
            ans=mid
            l=mid+1
        else:
            r=mid-1
    return ans
def fib(k,s):
    arr=[]
    i=1
    temp=True
    l=0
    while temp:
        if k>i:
            arr.append(0)
            l+=1
            if arr[-1]>s:
                arr.pop()
                l-=1
                break
            i=k
        elif k==i:
            arr.append(1)
            l+=1
            if arr[-1]>s:
                arr.pop()
                l-=1
                break
            i+=1
        else:
            if l<=k:
                num=sum(arr)
                arr.append(num)
                l+=1
                if arr[-1]>s:
                    arr.pop()
                    l-=1
                    break
            else:
                num+=arr[-1]
                num-=arr[-k-1]
                arr.append(num)
                l+=1
                if arr[-1]>s:
                    arr.pop()
                    l-=1
                    break
            i+=1
    return arr
s,k=list(map(int,input().split()))
arr=fib(k,s)
l=len(arr)-1
ans=arr[l]
lis=[ans]
while ans<s:
    temp=s-ans
    ind=binarySearch(arr,0,l,temp)
    ans+=arr[ind]
    lis.append(arr[ind])
answer=[]
a=len(lis)
if a==1:
    lis.append(0)
    a+=1
for i in range(1,a+1):
    answer.append(lis[-i])
print(a)
print(" ".join(str(x) for x in answer))

s,k=map(int,input().split())
f=[0]
f.append(1)
while(True):
    cur=sum(f[-k:])
    if cur>s:
        break
    f.append(cur)
f=list(set(f))
f.sort()
ans=[]
i=len(f)-1
while(s and i>0):
    if f[i]<=s:
        s-=f[i]
        ans.append(f[i])
    i-=1
print(len(ans)+1)
print(*(ans+[0]))

import bisect
s,k=list(map(int,input().split()))
f=[0]*45
for i in range(45):
    if i==0 or i==1:
        f[i]=1
    elif i<k:
        f[i]=sum(f[:i])
    else:
        f[i]=sum([f[i-j] for j in range(1,k+1)])
ans=[0]
while s>0:
    i=bisect.bisect_right(f,s)
    ans.append(f[i-1])
    s=s-f[i-1]
print(len(ans))
for i in range(len(ans)):
    print(ans[i],end=' ')

s, k = map(int, input().split())
f = [1]
while f[-1] < s:
	x = 0
	for i in range(max(0, len(f)-k), len(f)):
		x += f[i]
	f.append(x)
result = [0]
pos = len(f)-1
while s != 0:
	while f[pos] > s:
		pos -= 1
	result.append(f[pos])
	s -= f[pos]
print(len(result))
print(' '.join(map(str, result)))

s,k=map(int,input().split())
arr=[0,1];k1=1;visited=[];mini=0
while(arr[-1]<s):
    arr.append(sum(arr[-k::]))
while(s>0):
    for i in arr:
        if(i<=s):mini=i;
        else:break;
    s-=mini;visited.append(mini);
if(len(visited)==1):visited.append(0);
print(len(visited))
print(*visited)

s, k = map(int, input().split())
freq = [1]
while freq[-1] < s:
	x = 0
	for i in range(max(0, len(freq)-k), len(freq)):
		x += freq[i]
	freq.append(x)
res = [0]
idx = len(freq) - 1
while s != 0:
	while freq[idx] > s:
		idx -= 1
	res.append(freq[idx])
	s -= freq[idx]
print(len(res))
print(*res)

def power(a, b):
    if b == 0:
        return 1
    elif b % 2 == 0:
        a_1 = a * a
        return pow(a_1, b // 2)
    return a * pow(a, b - 1)

def k_fib(s, k):
    result = [0]
    if k >= 40:
        fibs = [power(2, i) for i in range(40)]
    else:
        fibs = [0] * (k - 1) + [1]
        while fibs[len(fibs) - 1] < s:
            fibs.append(sum(fibs[-k:]))
    while s > 0:
        if fibs[len(fibs) - 1] <= s:
            result.append(fibs[len(fibs) - 1])
            s -= fibs[len(fibs) - 1]
        fibs.pop()
    return result

S, K = [int(j) for j in input().split()]
print(len(k_fib(S, K)))
print(*k_fib(S, K))

"""
    Template written to be used by Python Programmers.
    Use at your own risk!!!!
    Owned by enraged(rating - 5 star at CodeChef and Specialist at Codeforces).
"""
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
# sys.setrecursionlimit(2*pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(var): sys.stdout.write(str(var))
def outln(var): sys.stdout.write(str(var)+"\n")
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

def k_bonacci(n):
    if n < k:
        return 0
    if n == k:
        return 1
    if n in dp.keys():
        return dp[n]
    dp[n] = 0
    for i in range(n-k, n):
        dp[n] += k_bonacci(i)
    return dp[n]

s, k = sp()
answer = []
if k <= 32:
    dp = dd(int)
    i = 1
    while True:
        dp[i] = k_bonacci(i)
        if dp[i] >= pow(10, 9):
            break
        i += 1
    arr = list(dp.values())
    while s > 0:
        temp = bl(arr, s)
        if arr[temp] > s:
            temp -= 1
        s -= arr[temp]
        answer.append(arr[temp])
else:
    i = 32
    while i >= 0 and s > 0:
        if pow(2, i) <= s:
            s -= pow(2, i)
            answer.append(pow(2, i))
        i -= 1
if len(answer) < 2:
    answer.insert(0, 0)
outln(len(answer))
print(*answer)

s,k=map(int,input().split())
f=[0]
f.append(1)
while(True):
    cur=sum(f[-k:])
    if cur>s:
        break
    f.append(cur)
f=list(set(f))
f.sort()
ans=[]
i=len(f)-1
while(s and i>0):
    if f[i]<=s:
        s-=f[i]
        ans.append(f[i])
    i-=1
print(len(ans)+1)
print(*(ans+[0]))

#Copied

s, k = map(int, input().split())
p, t, l = [0], [0, 1, 1], 2
while t[l] < s:
    t.append((t[l] << 1) - (0 if l < k else t[l - k]))
    l += 1
t.reverse()
for i in t:
    if i > s: continue
    p.append(i)
    s -= i
    if s == 0: break
print(len(p))
print(' '.join(map(str, p)))

s, k = map(int, input().split())

p, t, l = [0], [0, 1, 1], 2

while t[l] < s:

    t.append((t[l] << 1) - (0 if l < k else t[l - k]))

    l += 1

t.reverse()

for i in t:

    if i > s: continue

    p.append(i)

    s -= i

    if s == 0: break

print(len(p))

print(' '.join(map(str, p)))

# Made By Mostafa_Khaled

s,k=map(int,input().split())
F = [0,1]
b = set()
while True:
    f = sum(F[-k:])
    if f > s:
        break
    F.append(f)
for i in reversed(F):
    if i <= s:
        b.add(i)
        s -= i
print(len(b))
print (' '.join(map(str,b)))

#choose n maximal k bonnacii nums less than n and subtract them
#till n is decomposed...
#it will decompose..!
#coz any number can be represented as sum of
#fibonacci numbers

def s():
    [s,k] = list(map(int,input().split()))
    d = [0]
    d.append(1)
    t = 0
    r = []
    while t < s:
        t = sum(d[-min(k,len(d)):])
        d.append(t)
    for i in reversed(d):
        if i <= s:
            s -= i
            r.append(i)
            if i == 0:
                break
    print(len(r))
    print(*r)
s()

#0 1 1 2 3 5

def genkbon (s, k):
    if (k<50):
        i = 0
        res = [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
    if (k>=50):
        res = [0,1]
        i = 1
        while (res[i]<=s):
            res.append(2*res[i])
            i += 1
        return res

def solve(s, k, tmp):
    tmp2 = tmp
    while (tmp2[-1]>s):
        del tmp2[-1]
    if (s==0):
        return [0]
    if (s==1):
        return [0,1]
    if (s==2):
        return [0,2]
    ha = tmp2[-1]
    res = solve(s-ha,k,tmp2)
    return [ha]+res

inp1 = input()
inp = inp1.split()
hlp = genkbon(int(inp[0]),int(inp[1]))
sol = solve(int(inp[0]),int(inp[1]), hlp)
print(len(sol))
for i in sol[:-1]:
    print(i,end=' ')
print(sol[-1])

def genFib(k, n):
    cur = 1
    ind = -k + 2
    ret = [0, 1]
    while cur <= n:
        ret.append(cur)
        cur += cur
        if ind >= 0:
            cur -= ret[ind]
        ind += 1
    return ret

def get(n, cur, last):
    global f, m
    if n == 0:
        cur.append(0)
        print len(cur)
        print ' '.join(map(str, cur))
        exit(0)
    for i in range(last, m):
        x = f[i]
        if x <= n:
            get(n - x, cur + [x], i + 1)

n, k = map(int, raw_input().split())
f = genFib(k, n)[::-1]
m = len(f)
get(n, [], 0)
exit(1)

import sys
if sys.version_info[0] == 2: input = raw_input
s, k = map(int,input().split())
if s == 1:
    print('2\n0 1')
    sys.exit(0)
elif s==2:
    print('2\n0 2')
    sys.exit(0)
n = 2
ans = []
a = [0] * 100
a[0] = a[1] = 1
while a[n-1] < s:
    a[n] = 2*a[n-1]-(a[n-k-1] if n-k-1>=0 else 0)
    n += 1

for i in range(n-1,-1,-1):
    if a[i] <= s:
        ans.append(a[i])
        s -= a[i]
        if s == 0: break
print(len(ans) + 1)
print('0 ' + " ".join(map(str,ans)))

s,k=map(int,raw_input().split())
f,sm=[0,1,1],[0]
ssum=0
while ssum<s :
    i=k+2
    sumi=1
    while sumi<=s-ssum :
        sumi+=f[i-k]
        i+=1
        if ssum==0 :
            f.append(2*f[i-k-1])
            if i-k-k-1 >=0 :
                f[i-k]=f[i-k]-f[i-k-k-1]
    ssum+=f[i-k-1]
    sm.append(f[i-k-1])
print(len(sm))
print(" ".join([str(i) for i in sm]))

s,k=map(int,raw_input().split())
a,b=[0,1],[]
while a[-1]<s:
  a.append(sum(a[-k:]))
for i in reversed(a):
  if i<=s:
    b.append(i)
    s-=i
print len(b)
print ' '.join(map(str,b))

s, k = map(int, raw_input().split())
F = [1]
total = 1
while len(F) < k and F[-1] <= s :
    val = F[-1]
    F.append(total + val)
    total += val

while F[-1] <= s:
    val = sum(F[-k:])
    F.append(val)
    total += val

C = []
F = F[::-1]
def find_recur(n):
    if n > 0:
        if n in F:
            C.append(n)
        else:
            x = next(x for x in F if x < n)
            if x is not None:
                C.append(x)
                y = find_recur(n - x)
                if y is not None:
                    C.append(y)
    return None
if s in F:
    print 2
    print 0, s
    exit()
else:
    find_recur(s)
    print(len(C))
    print " ".join(map(str, C))

s, k = map(int, raw_input().split())
f = [1, 1]
while f[-1] < 10 ** 9 + 10:
    if len(f) > k:
        f.append(f[-1] * 2 - f[-k-1])
    else:
        f.append(f[-1] * 2)
ans = [0]
i = -1
while s > 0:
    x = f[i]
    if s >= x:
        ans.append(x)
        s -= x
    i -= 1
print len(ans)
for x in ans:
    print x,

s, k = map(int, raw_input().split())
a = [0, 1]
while a[-1] < s: a.append(sum(a[-k:]))
b = []
for i in reversed(a):
    if i <= s:
        b.append(i)
        s -= i
print len(b)
print ' '.join(map(str, b))

kb = [0,1]
s,k = map(int,raw_input().split())
while kb[-1] < s:
    kb.append(sum(kb[-k:]))
r = [0]
for i in kb[::-1]:
    if s == 0: break
    elif s >= i:
        r.append(i)
        s -= i
print len(r)
print ' '.join(map(str,r))

kb = [0,1]
s,k = map(int,raw_input().split())
while kb[-1] < s:
    kb.append(sum(kb if len(kb) < k else kb[-1:-1-k:-1]))
r = [0]
for i in xrange(len(kb)-1,-1,-1):
    if s == 0: break
    elif s >= kb[i]:
        r.append(kb[i])
        s -= kb[i]
print len(r)
print ' '.join(map(str,r))

l = [0,1]
s,k = map(int,raw_input().split())
while 1:
    t = sum(l if len(l) < k else l[-1:-1-k:-1])
    if t > s: break
    l.append(t)
r = []
for i in xrange(len(l)-1,-1,-1):
    if s == 0:
        if len(r) < 2: r.append(0)
        break
    elif s >= l[i] and l[i] not in r:
        r.append(l[i])
        s -= l[i]
print len(r)
print ' '.join(map(str,r))

############
kb = [0,1]
s,k = map(int,raw_input().split())
while kb[-1] < s:
    kb.append(sum(kb[-k:]))
r = [0]
for i in kb[::-1]:
    if s == 0: break
    elif s >= i:
        r.append(i)
        s -= i
print len(r)
print ' '.join(map(str,r))

kbs, ans = [0, 1], [0]
s, k = map(int, raw_input().split())
while kbs[-1] < s:
    kbs.append(sum(kbs[0-min(len(kbs),k):]))
while s > 0:
    if kbs[-1] <= s:
        ans.append(kbs.pop())
        s -= ans[-1]
    else:
        kbs.pop()
print len(ans)
print ' '.join(map(str, ans))

s,k=map(int,raw_input().split())
t={}
def f(a,b):
    s=0
    if b < a:  s=0
    elif b == a: s=1
    elif b in t:
        s=t[b]
    elif a > 32: s=2**(b-a-1)
    else:
        for i in range(b-a,b):
            s+=f(a,i)
    t[b] = s
    return s

i=max(0,k-2)
e=0
F=[]
while e < s:
    i+=1
    e=f(k,i)
    if e < s or 0 in F:
        F+=[e]

r=[]
for e in reversed(F):
    if e <= s and e:
        r+=[`e`]
        s-=e
if len(r)==1 and 0 in F:
    r+=['0']
print len(r)
print ' '.join(r)

import math

n = raw_input().split()
s = int(n[0])
k = int(n[1])

a = [0,1,1]
i = len(a)
while True:
	t = 0
	for j in xrange(1,k+1):
		t += a[i-j]
		if a[i-j] == 0:
			break
	if t > s:
		break
	a.append(t)
	i += 1
#print a
a = list(set(a))
a.sort(reverse=True)

ans = []
for i in a:
	if i <= s:
		s -= i
		ans.append(i)
if s != 0:
	print "you can't"

print len(ans)
for i in ans:
	print i,

def first_fib(s,k):
    bon = [0,1]
    summ = 0
    while summ < s:
        summ = 0
        if len(bon) < k: count = len(bon)
        else: count = k
        last = bon.index(max(bon))
        summ = sum(bon[-count:-1])+bon[last]
        bon.append(summ)
    del bon[last+1]
    return bon
bon = [0]
i = 0
s,k = map(int,raw_input().split())
if s == 1: print "2" + "\n" + "1 0"
elif s == 2: print "2" + "\n" + "2 0"
elif s == 3: print "2" + "\n" + "1 2"
elif s == 4: print "2" + "\n" + "4 0"
else:
    if k<32: bon = first_fib(s,k)
    else:
        while (2**i) < s:
            bon.append(2**i)
            i+=1
    arr = []
    while s != 0:
        if s >= bon[-1]:
            s-=bon[-1]
            arr.append(bon.pop())
        else:
            del bon[-1]
    l = len(arr)
    print l
    print ' '.join(map(str,arr))

n,k=map(int,raw_input().split())
lst=[0,1]
s=1
k=min(k,30)
for i in range(2,k):
  lst.append(s)
  s=s+lst[-1]
for i in range(0,70):
  s=0
  #print i,
  for j in range(i,i+k):
    s=s+lst[j]
    #print s,lst[j],j
  lst.append(s)
ans=[]
#print lst
lc=0
for i in range(len(lst)-1,-1,-1):
  if n>0 and  lst[i]<=n:
    if lst[i] not in ans:
      ans.append(lst[i])
      n=n-lst[i]
      lc=lc+1
if 0 not in ans:
  ans.append(0)
print len(ans)
for i in ans:
  print i,
print

s, k = map(int, raw_input().split())
a = [1]
while a[-1] < s:
	a.append(sum(a[-k : ]))
r = []
for x in a[ : : -1]:
	if s >= x:
		s -= x
		r.append(`x`)
r.append(`s`)
print len(r)
print ' '.join(r)

s, k = map(int, raw_input().split())
a = [1]
while a[-1] < s:
	a.append([sum(a[-k : ]), sum(a)][len(a) < k])
r = []
for x in a[ : : -1]:
	if s >= x:
		s -= x
		r.append(`x`)
r.append(`s`)
print len(r)
print ' '.join(r)

#!/usr/bin/env python
# -*- coding: utf-8 -*-
kbs, ans = [0, 1], [0]
s, k = map(int, raw_input().split())
while kbs[-1] < s:
    kbs.append(sum(kbs[0-min(len(kbs),k):]))
while s > 0:
    if kbs[-1] <= s:
        ans.append(kbs.pop())
        s -= ans[-1]
    else:
        kbs.pop()
print len(ans)
print ' '.join(map(str, ans))

import bisect

def start():
    s, k = map(int, raw_input().split())
    kbonacci = [0]
    kbonacci.append(1)
    i = 2
    while kbonacci[i-1] < s:
        kbonacci.append(sum(kbonacci[max(1,i-k):i]))
        i = i+1
    summr = [0]
    while s > 0:
        bl = bisect.bisect_left(kbonacci,s)
        if kbonacci[min(bl, len(kbonacci)-1)] == s:
            summr.append(s)
            break
        else:
           s = s-kbonacci[bl-1]
           summr.append(kbonacci[bl-1])
    print len(summr)
    for x in summr:
        print x,

start()

s,k=map(int,raw_input().split())
f=[0,1]
ss=1
tpos=1
tpos_d=-k+2
while f[-1]<s:
    f.append(ss)
    ss=ss+ss
    if tpos_d>=0:
        ss-=f[tpos_d]
    tpos+=1
    tpos_d+=1
rere=[0]
x=1
while s>0:
    while f[-x]>s:
        x+=1
    s-=f[-x]
    rere.append(f[-x])
print len(rere)
print " ".join(map(str,rere))

import sys

def k_fib(k, upper_bound):
    if upper_bound < 2:
        return upper_bound
    f = [1]
    while len(f) < k and f[-1] * 2 <= upper_bound:
        f.append(f[-1] * 2)
    while len(f) == k and sum(f) <= upper_bound:
        f.append(sum(f))
        f.remove(f[0])
    return f[-1]

def main():
    s, k = map(lambda x: int(x), sys.stdin.readline().split())
    a = []
    while s > 0:
        f = k_fib(k, s)
        a.append(f)
        s -= f
    if len(a) == 1:
        a.append(0)
    print len(a)
    print ' '.join(map(lambda x: str(x), a))

if __name__ == '__main__':
    main()

n, k = map(int, raw_input().split())

bona = [1]

cnt = 0

while bona[-1] < n:
    if cnt < k:
        bona.append(2 ** cnt)
    else:
        bona.append(sum(bona[-k:]))
    cnt += 1

ans = []

while n > 0:
    while bona[-1] > n:
        bona.pop()
    ans.append(bona[-1])
    n -= bona[-1]

if len(ans) == 1:
    ans.append(0)

print len(ans)
print ' '.join(map(str, ans))

import bisect
s,k=map(int,raw_input().split())
if k>31:
    a=[0,1,2]
    while a[-1] < s:a.append(a[-1]*2)
else:
    a=[0]*(k-1)+[1]
    while a[-1] < s:a.append(sum(a[-k:]))
curr = bisect.bisect_left(a, s)
ans=[]
while s:
    curr = bisect.bisect_left(a, s)
    if a[curr] > s:curr-=1
    ans.append(a[curr])
    s-=a[curr]
ans+=[0]
print len(ans)
print " ".join(map(str,ans))

s,k = map(int,raw_input().split());

A = [0,1];
su = 0;
l = 1;
for i in xrange(k-1):
	su += l;
	l = su;
	A.append(l);
	if su >= s: break;

su += l;
q = A;
i = 1;
while A[-1] < s:
	A.append(su);
	su -= A[i];
	su += A[-1];
	i += 1;

B = [];
while s :
	while A[-1] > s: A.pop();
	s -= A[-1];
	B.append(A[-1]);

if len(B) < 2:
	B.append(0);
print len(B);
print " ".join([str(b) for b in B]);

s,k=map(int,raw_input().split())
a,b=[0,1],[]
while a[-1]<s:
  a.append(sum(a[-k:]))
for i in reversed(a):
  if i<=s:
    b.append(i)
    s-=i
print len(b)
print ' '.join(map(str,b))

n,k = map(int,raw_input().split())

ans = [0]
if k >= 32:
    b = []
    while n > 0:
        b.append(n%2)
        n/=2
    for i in xrange(len(b)):
        if b[i] == 1:
            ans.append(2**i)
else:
    arr = [0 for i in xrange(k-1)]
    arr.append(1)
    ind = 0
    while arr[-1] < n:
        arr.append(sum(arr[ind:k+ind]))
        ind +=1
    ind = len(arr) -1
    while n > 0:
        if arr[ind] <= n:
            n -= arr[ind]
            ans.append(arr[ind])
        ind -= 1

print len(ans)
print " ".join(map(str,ans))

def s():
    [s,k] = list(map(int,input().split()))
    d = [0]
    d.append(1)
    t = 0
    r = []
    while t < s:
        t = sum(d[-min(k,len(d)):])
        d.append(t)
    for i in reversed(d):
        if i <= s:
            s -= i
            r.append(i)
            if i == 0:
                break
    print(len(r))
    print(*r)
s()

fibarr = []
dp = []
predecessor = []
def gen_list(s, k):
    global fibarr

    fibarr = [0, 1, 1]
    idx = 3
    while fibarr[idx - 1] <= s :
        fibarr.append(fibarr[idx-1] * 2 - fibarr[max(idx - k - 1, 0)])
        idx += 1

if __name__ == '__main__':
    int_s, int_k = map(int, raw_input().split())

    gen_list(int_s, int_k)
    int_rem = int_s
    answer = []
    for ii in xrange(len(fibarr)-1, -1, -1) :
        if int_rem == 0 :
            break
        if (fibarr[ii] > int_rem) :
            continue
        else :
            int_rem -= fibarr[ii]
            answer.append(fibarr[ii])
    if len(answer)==1 :
        answer.append(0)
    #print fibarr

    print len(answer)
    res = ""
    for item in answer :
        res+=str(item)+" "
    res = res[0:len(res)-1]
    print res
    pass

s,k = map(int,input().split())

if k>=32:
    k_bon = [0]
    for i in range(33):
        k_bon.append(2**i)
else:
    k_bon = [0]*(k-1)
    k_bon.append(1)
    i = k+1
    c = 0
    while len(k_bon)<=100:
        next = sum(k_bon[c:i])
        k_bon.append(next)
        i+=1
        c+=1

k_bon = set(k_bon)
i = 0
ans = []
k_bon = sorted(list(k_bon))
# print(k_bon)
while s!=0:
    if k_bon[i] >= s:
       if s == k_bon[i]:
        s-=k_bon[i]
        # print(s)
        ans.append(k_bon[i])
        i = 0
       else:

        s-=k_bon[i-1]
        # print(s)
        ans.append(k_bon[i-1])
        i = 0

    else:
        i+=1
if len(ans) == 1:
    ans.append(0)
print(len(ans))
print(*ans)

s,k=map(int,input().split())
f=[0]
f.append(1)
while(True):
    cur=sum(f[-k:])
    if cur>s:
        break
    f.append(cur)
f=list(set(f))
f.sort()
ans=[]
i=len(f)-1
while(s and i>0):
    if f[i]<=s:
        s-=f[i]
        ans.append(f[i])
    i-=1
print(len(ans)+1)
print(*(ans+[0]))

x,y=map(int,input().split())
dp=[]
dp.append(0)
dp.append(1)

n=2
while 1:
    sm=0
    for k in range(n-1,n-y-1,-1):
        if k==0:
            break
        sm+=dp[k]
    if sm>x:
        break
    dp.append(sm)
    n+=1

dp.reverse()
res=[]

n=0
while n<len(dp) and x>=0:
    if x>=dp[n]:
        res.append(dp[n])
        x-=dp[n]
    n+=1

print(len(res))
print(*res)

s,k=list(map(int,input().split(' ')))
a=[0,1,1]
while a[-1]<s:
    if len(a)<k:
        a.append(sum(a))
    else:
        t=0
        for i in range(k):
            t+=a[-i-1]
        a.append(t)
if s==a[-1]:
    print(2)
    print(0,a[-1])
else:
    use=[]
    for i in range(len(a)):
        if s>=a[-i-1]:
            s-=a[-i-1]
            use.append(a[-i-1])
    print(len(use))
    for i in use:
        print(i,end=' ')

s,k=map(int,input().split())
a,b=[0,1],[]
while a[-1]<s:
  a.append(sum(a[-k:]))
#print(a)
for i in reversed(a):
  if i<=s:
    b.append(i)
    s-=i
print(len(b))
print(' '.join(map(str,b)))

[s, k] = [int(x) for x in input().split()]

numbers = [1]
numbers.append(1)

last = 1
index = 1
while last <= s:
    l_index = index-k
    if l_index >= 0:
        last = last * 2 - numbers[l_index]
    else:
        last *= 2
    # print(last, l_index)
    if last <= s:
        numbers.append(last)
    index += 1

numbers.reverse()
numbers.append(0)

# for s in range(0, 100000):
output = []
for i in numbers:
    if i <= s:
        s -= i
        output.append(i)

print(len(output))
print(" ".join([str(x) for x in output]))

#coding=utf-8

#import Set
def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

#for i in range(1,20):
#	for j in range(1,20):
#		print "%3d"%F(i,j),
#	print

def Gen_F(k,MAX):
	if k == 1:
		return [0,1]
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb <= MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L

s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)

#print [F(k,i) for i in range(k,k+20)]
#print FL

FL = list(reversed(sorted(list(set(FL)))))

#print FL

ans = []
for i in FL:
	if s >= i:
		#print s,i
		ans.append(i)
		s = s - i

print len(ans)
for i in ans:
	print i,
print

s, k = map(int, raw_input().split())
l = [0, 1]
while True:
    l.append(sum(l[-k:]))
    if (l[-1] > s):
        l = l[:-1]
        break
#print '#', s, l
ans = []
for i in l[::-1]:
    if s >= i:
        s -= i
        ans.append(i)

print len(ans)
print ' '.join(map(str, ans))

s, k = map(int, raw_input().split())
a = [0, 1]
while a[-1] < s: a.append(sum(a[-k:]))
b = []
for i in reversed(a):
    if i <= s:
        b.append(i)
        s -= i
print len(b)
print ' '.join(map(str, b))

def Sum(a, l, r):
    s = 0
    for i in range(l, r):
        s += a[i]
    return s

def main():
    F = [1]

    s, k = map(int, raw_input().split())

    n = k
    while True:
        n += 1
        if n > k:
            f = Sum(F, max(0, n - k - k), n - k)

        if f > s:
            break
        F.append(f)

    F = F[1:]
    F.reverse()

    res = [0]
    for f in F:
        if s == 0:
            break
        if s >= f:
            res.append(f)
            s -= f

    print len(res)
    print " ".join(map(str, res))

if __name__ == "__main__":
    main()

s,k=map(int,raw_input().split())
f = [0]*200+[1]
while True:
  l = min(len(f),k)
  f.append(sum(f[-l:]))
  if s<f[-1]:
    break

res = []
while s>0:
  if s in f:
    res.append(s)
    res.append(0)
    s=0
  else:
    i=0
    while not f[i]<s<f[i+1]:
      i+=1
    res.append(f[i])
    s-=f[i]
res.reverse()

print len(res)
for x in res:
  print x,
print

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')]

l = []
s,k = li()
i = 0

sum = [0 for i in range(10**6)]
a = sum[:]
a[1]=1;
sum[1]=1;
for i in range(2,10**13):

    if(i<=k):
        a[i]=sum[i-1];
    else:a[i]=sum[i-1]-sum[i-k-1];
    if(a[i]>s):
        n=i;break;
    sum[i]=sum[i-1]+a[i];

l = sorted(list(set(l)))
ans = [0]
i = n-1
while s and i:
    if s - a[i] >= 0:
        ans.append(a[i])
        s -= a[i]
    i-=1
print(len(ans))
print(*ans)

s, k = map(int, raw_input().split())
a = [0, 1]
while a[-1] < s:	a.append(sum(a[-k:]))
#print a
b = []
for i in reversed(a):
	if i <= s:
		b.append(i)
		s -= i
print len(b)
print ' '.join(map(str, b))

myin = raw_input()
myin = myin.split()

mysum = int(myin[0])
myk = int(myin[1])

kbon = [0]
kbon.append(1)

while kbon[len(kbon) - 1] < mysum:
    if len(kbon) < myk:
        kbon.append(sum(kbon))
    else:
        temp = 0
        for i in range(myk):
            temp += kbon[len(kbon) - 1 - i]
        kbon.append(temp)

myout = []

mysumtemp = mysum
count = 0

for i in range(len(kbon) - 1, -1, -1):
    if kbon[i] == 0:
        count += 1
        if count == 2:
            break
    if kbon[i] <= mysumtemp:
        myout.append(kbon[i])
        mysumtemp -= kbon[i]

print len(myout)
outtemp = ''
for i in myout:
    outtemp += str(i) + ' '

outtemp = outtemp[:len(outtemp) - 1]
print outtemp

s,k=[int(i) for i in input().split()]
a=[-1,0,1,1]
i=3
while a[i]<=pow(10,9):
    i+=1
    a.append(0)
    if i<=k:
        for j in range(1,i):
            a[i]+=a[j]
    else:
        for j in range(i-k,i):
            a[i]+=a[j]
b=[]
for j in range(i,0,-1):
    if a[j]<=s:
        b.append(a[j])
        s-=a[j]
        if s==0:
            b.append(0)
            break
print(len(b))
for i in b:
    print(i,end=' ')

# -*- coding: utf-8 -*-

from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import nested_scopes
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement

import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import operator
import os
import re
import random
import sys
from pprint import pprint

__author__ = 'Aphrodite'

def main():
    iterator = itertools.imap(str.rstrip, sys.stdin.readlines())
    s, k = map(int, next(iterator).split())
    a = [0, 1]
    while a[-1] < s:
        if (len(a)) < k:
            a.append(sum(a))
        else:
            a.append(sum(a[-k:]))
#    print(a)
    res = []
    while s > 0:
        idx = bisect.bisect(a, s) - 1
        s -= a[idx]
        res.append(a[idx])
    if len(res) == 1:
        res.append(0)
    print(len(res))
    print(' '.join(map(str, res)))

if __name__ == '__main__':
    main()

s,k=map(int,raw_input().split())
a,b=[0,1],[]
while a[-1]<s:
  a.append(sum(a[-k:]))
for i in reversed(a):
  if i<=s:
    b.append(i)
    s-=i
print len(b)
print ' '.join(map(str,b))

s, k = map(int, raw_input().split())
a = [0,1]
b = []

while a[-1] < s:
    a.append(sum(a[-k:]))

for i in reversed(a):
    if i <= s:
        b.append(i)
        s -= i

print len(b)
for i in b:
    print i,

s, k = map(int, raw_input().split())
sums, sequence = 1, [1]
while sums <= s:
    sequence.append(sums)
    sums += sums
    if len(sequence) > k:
        sums -= sequence[-(k + 1)]
result = []
for i in reversed(sequence):
    if i <= s:
        s -= i
        result.append(i)
if len(result) == 1:
    result.append(0)
print len(result)
print " ".join(map(str, result))

#import sys
#
#sys.stdin = open('in.txt', 'r')

s, k = map(int, raw_input().split())
fib = [0, 1, 1]

while(True):
    fib.append(sum(fib[-k:]))
    if fib[-1] > s:
        del fib[-1]
        break

ans = []

while(True):
    x = fib.pop()
    if x <= s:
        s -= x
        ans.append(x)
    if s == 0:
        break
ans.append(0)
print len(ans)
print ' '.join(map(str, ans))

NAME = "P2"
try:
    inFile = open(NAME+".txt")
except:
    pass

def read():
    try:
        return inFile.readline().strip()
    except:
        return raw_input().strip()

s,k = map(int,read().split())
seq = [1,1]
n = 2
x = 1

while seq[-1] < s:
    x *= 2
    if n > k:
        x -= seq[n-k-1]
    seq.append(x)
    n += 1
#print seq

ans = []
i = len(seq)-1
while s > 0:
    while seq[i] > s:
        i -= 1
    ans.append(seq[i])
    s -= seq[i]
if len(ans) == 1:
    ans.append(0)

print len(ans)
print " ".join(map(str,ans))

def main():
    cin = lambda: map(int, raw_input().split())
    [s, k] = cin()
    ans = []
    a = [0, 1]
    while a[-1] < s:
        a.append(sum(a[-k:]))
    for i in reversed(a):
        if i <= s:
            ans.append(i)
            s -= i
    print len(ans)
    for a in ans:
        print a,

if __name__ == '__main__':
    main()

def readInt():
    return tuple([int(x) for x in raw_input().split()])

s, k = readInt()
if k >= 40:
    fib = [2**i for i in xrange(40)]
else:
    fib = [0] * (k - 1) + [1]
    while fib[-1] < s:
        fib.append(sum(fib[-k:]))
ans = [0]
while s > 0:
    if fib[-1] <= s:
        ans.append(fib[-1])
        s -= fib[-1]
    fib.pop()
print len(ans)
print " ".join([str(x) for x in ans])

s,k = map(int,raw_input().split())
fib = [0,1]
for i in xrange(80):
	x=0
	for j in xrange(k):
		if len(fib)-j-1 < 0:
			break
		x += fib[len(fib)-j-1]
	fib.append(x)

ans = []
for i in reversed(fib):
	if i <= s:
		s -= i
		ans.append(i)

print len(ans)
for i in ans:
	print i,

s,k = map(int,raw_input().split())
fib = [0,1]
for i in xrange(32):
	x=0
	for j in xrange(k):
		if len(fib)-j-1 < 0:
			break
		x += fib[len(fib)-j-1]
	fib.append(x)

ans = []
for i in reversed(fib):
	if i <= s:
		s -= i
		ans.append(i)

print len(ans)
for i in ans:
	print i,

n,k=map(int,raw_input().split())
lst=[0,1]
s=1
k=min(k,30)
for i in range(2,k):
  lst.append(s)
  s=s+lst[-1]
for i in range(0,30):
  s=0
  #print i,
  for j in range(i,i+k):
    s=s+lst[j]
    #print s,lst[j],j
  lst.append(s)
ans=[]
#print lst

for i in range(len(lst)-1,-1,-1):
  if n>0 and lst[i]<=n:
    if lst[i] not in ans:
      ans.append(lst[i])
      n=n-lst[i]
print len(ans)
for i in ans:
  print i,
print

n,k=map(int,raw_input().split())
lst=[0,1]
s=1
k=min(k,30)
for i in range(2,k):
  lst.append(s)
  s=s+lst[-1]
for i in range(0,30):
  s=0
  #print i,
  for j in range(i,i+k):
    s=s+lst[j]
    #print s,lst[j],j
  lst.append(s)
ans=[]
#print lst
lc=0
for i in range(len(lst)-1,-1,-1):
  if n>0 and (lc>0 and lst[i]<=n) or (lc==0 and lst[i]<n) :
    if lst[i] not in ans:
      ans.append(lst[i])
      n=n-lst[i]
      lc=lc+1
print len(ans)
for i in ans:
  print i,
print

n,k=map(int,raw_input().split())
lst=[0,1]
s=1
k=min(k,30)
for i in range(2,k):
  lst.append(s)
  s=s+lst[-1]
for i in range(0,30):
  s=0
  #print i,
  for j in range(i,i+k):
    s=s+lst[j]
    #print s,lst[j],j
  lst.append(s)
ans=[]
#print lst
lc=0
for i in range(len(lst)-1,-1,-1):
  if n>0 and  lst[i]<=n:
    if lst[i] not in ans:
      ans.append(lst[i])
      n=n-lst[i]
      lc=lc+1
ans.append(0)
print len(ans)
for i in ans:
  print i,
print

import bisect
s,k=map(int,raw_input().split())
if k>31:
    a=[0,1,2]
    while a[-1] < s:a.append(a[-1]*2)
else:
    a=[0]*(k-1)+[1]
    while a[-1] < s:a.append(sum(a[-k:]))
curr = bisect.bisect_left(a, s)
ans=[a[curr-1]]
s -= a[curr-1]
while s:
    curr = bisect.bisect_left(a, s)
    if a[curr] > s:curr-=1
    ans.append(a[curr])
    s-=a[curr]
if len(ans) == 1:ans+=[0]
print len(ans)
print " ".join(map(str,ans))

x,y=map(int,input().split())
dp=[]
dp.append(0)
dp.append(1)

n=2
while 1:
    sm=0
    for k in range(n-1,n-y-1,-1):
        if k==0:
            break
        sm+=dp[k]
    if sm>=x:
        break
    dp.append(sm)
    n+=1

dp.reverse()
res=[]

n=0
while n<len(dp) and x>0:
    if x>=dp[n]:
        res.append(dp[n])
        x-=dp[n]
    n+=1

print(len(res))
print(*res)

x,y=map(int,input().split())
dp=[]
dp.append(0)
dp.append(1)

n=2
while 1:
    sm=0
    for k in range(n-1,n-y-1,-1):
        if k==0:
            break
        sm+=dp[k]
    if sm>=x:
        break
    dp.append(sm)
    n+=1

dp.reverse()
res=[]

n=0
while n<len(dp) and x>=0:
    if x>=dp[n]:
        res.append(dp[n])
        x-=dp[n]
    n+=1

print(len(res))
print(*res)

[s, k] = [int(x) for x in input().split()]
if s == 1:
    print(2)
    print(1,0)
    exit()
numbers = [1]
numbers.append(1)

last = 1
index = 1
while last < s:
    l_index = index-k
    if l_index >= 0:
        last = last * 2 - numbers[l_index]
    else:
        last *= 2
    # print(last, l_index)
    if last != s:
        numbers.append(last)
    index += 1

numbers.reverse()

# for s in range(0, 100000):
output = []
for i in numbers:
    if i <= s:
        s -= i
        output.append(i)

print(len(output))
print(" ".join([str(x) for x in output]))

[s, k] = [int(x) for x in input().split()]

numbers = [1]
numbers.append(1)

last = 1
index = 1
while last <= s:
    l_index = index-k
    if l_index >= 0:
        last = last * 2 - numbers[l_index]
    else:
        last *= 2
    # print(last, l_index)
    if last != s:
        numbers.append(last)
    index += 1

numbers.reverse()
numbers.append(0)

# for s in range(0, 100000):
output = []
for i in numbers:
    if i <= s:
        s -= i
        output.append(i)

print(len(output))
print(" ".join([str(x) for x in output]))

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 giventhfib(k,n,l):
    if n<k:return 0
    elif n == k:return 1
    tot = 0
    for i in range(1,k+1):tot += l[-i]
    return tot

l = []
s,k = li()
i = 0
while not len(l) or l[-1] < s:
    l.append(giventhfib(k,i,l))
    i += 1
l = list(set(l))
ans = []
i = len(l)-1
while s:
    if s - l[i]>=0:
        ans.append(l[i])
        s -= l[i]
    i-=1
print(len(ans))
print(*ans)

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 giventhfib(k,n,l):
    if n<k:return 0
    elif n == k:return 1
    tot = 0
    for i in range(1,k+1):tot += l[-i]
    return tot

l = []
s,k = li()
i = 0
while not len(l) or l[-1] < s:
    l.append(giventhfib(k,i,l))
    i += 1
l = list(set(l))
ans = []
i = len(l)-1
while s and i:
    if s - l[i]>0 or(s==l[i] and len(ans)):
        ans.append(l[i])
        s -= l[i]
    i-=1
print(len(ans))
print(*ans)

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,2]
currsum = sum(l)
s,k = li()
while l[-1] <= s:
    l.append(currsum)
    currsum*=2
func(l,0,0,s,[])

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 giventhfib(k,n,l):
    if n<k:return 0
    elif n == k:return 1
    tot = 0
    for i in range(1,k+1):tot += l[-i]
    return tot

l = []
s,k = li()
i = 0
while not len(l) or l[-1] < s:
    l.append(giventhfib(k,i,l))
    i += 1
l = list(set(l))
ans = []
i = len(l)-1 if l[-1]!=s else len(l)-2
while s and i:
    if s - l[i] >= 0:
        ans.append(l[i])
        s -= l[i]
    i-=1
print(len(ans))
print(*ans)

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 giventhfib(k,n,l):
    if n<k:return 0
    elif n == k:return 1
    tot = 0
    for i in range(1,k+1):tot += l[-i]
    return tot

l = []
s,k = li()
i = 0
while not len(l) or l[-1] < s:
    l.append(giventhfib(k,i,l))
    i += 1
l = list(set(l))
ans = []
i = len(l)-1
while s and i:
    if s - l[i]>0 or(s==l[i] and (not len(ans) or l[i] != s) ):
        ans.append(l[i])
        s -= l[i]
    i-=1
print(len(ans))
print(*ans)

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,[])

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 giventhfib(k,n,l):
    if n<k:return 0
    elif n == k:return 1
    return sum(l[:n-1])

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 = []
s,k = li()
i = 0
while not len(l) or l[-1] <= s:
    l.append(giventhfib(k,i,l))
    i += 1
l = list(set(l))
func(l,0,0,s,[])

s,k=[int(i) for i in input().split()]
a=[-1,0,1,1]
i=3
while a[i]<=pow(10,9):
    i+=1
    a.append(0)
    if i<=k:
        for j in range(1,i):
            a[i]+=a[j]
    else:
        for j in range(i-k,i):
            a[i]+=a[j]
b=[]
for j in range(i,0,-1):
    if a[j]<s and len(b)==0:
        b.append(a[j])
        s-=a[j]
        if s==0:
            break
    else:
        if a[j]<=s and len(b)>0:
            b.append(a[j])
            s-=a[j]
            if s==0:
                break
print(len(b))
for i in b:
    print(i,end=' ')

s,k=[int(i) for i in input().split()]
a=[-1,0,1,1]
i=3
while a[i]<=pow(10,9):
    i+=1
    a.append(0)
    if i<=k:
        for j in range(1,i):
            a[i]+=a[j]
    else:
        for j in range(i-k,i):
            a[i]+=a[j]
for j in range(1,i+1):
    for j2 in range(1,i+1):
        for j3 in range(1,i+1):
            if a[j]!=a[j2]!=a[j3] and a[j]+a[j2]+a[j3]==s:
                print(3)
                print(a[j],a[j2],a[j3])
                exit()

s,k=[int(i) for i in input().split()]
a=[-1,0,1,1]
i=3
while a[i]<=pow(10,9):
    i+=1
    a.append(0)
    if i<=k:
        for j in range(1,i):
            a[i]+=a[j]
    else:
        for j in range(i-k,i):
            a[i]+=a[j]
b=[]
print(a)
for j in range(i,0,-1):
    if a[j]<s and len(b)==0:
        b.append(a[j])
        s-=a[j]
        if s==0:
            break
    else:
        if a[j]<=s and len(b)>0:
            b.append(a[j])
            s-=a[j]
            if s==0:
                break
print(len(b))
for i in b:
    print(i,end=' ')

s,k=[int(i) for i in input().split()]
a=[-1,0,1,1]
i=3
while a[i]<=pow(10,9):
    i+=1
    a.append(0)
    if i<=k:
        for j in range(1,i):
            a[i]+=a[j]
    else:
        for j in range(i-k,i):
            a[i]+=a[j]
for j in range(1,i+1):
    for j2 in range(1,i+1):
        for j3 in range(1,i+1):
            if (a[j]!=a[j2]) and(a[j2]!=a[j3]) and (a[j]!=a[j3]) and a[j]+a[j2]+a[j3]==s:
                print(3)
                print(a[j],a[j2],a[j3])
                exit()
for j2 in range(1,i+1):
    for j3 in range(1,i+1):
        if (a[j2]!=a[j3]) and a[j2]+a[j3]==s:
            print(2)
            print(a[j2],a[j3])
            exit()

s,k=[int(i) for i in input().split()]
a=[-1,0,1,1]
i=3
while a[i]<=pow(10,9):
    i+=1
    a.append(0)
    if i<=k:
        for j in range(1,i):
            a[i]+=a[j]
    else:
        for j in range(i-k,i):
            a[i]+=a[j]
b=[]
print(a)
for j in range(i,0,-1):
    if a[j]<=s:
        b.append(a[j])
        s-=a[j]
        if s==0:
            b.append(0)
            break
print(len(b))
for i in b:
    print(i,end=' ')

s, k = map(int, raw_input().split())
f = [1]
while f[-1] < 10 ** 9 + 10:
    if len(f) > k:
        f.append(f[-1] * 2 - f[-k-1])
    else:
        f.append(f[-1] * 2)
ans = []
t = s
while s > 0:
    for x in reversed(f):
        if s >= x and t > x:
            ans.append(x)
            s -= x
            break
print len(ans)
for i in ans:
    print i,

class Main:
	s=raw_input().split(" ")
	l=[int(x) for x in s]
	s=l[0]
	k=l[1]
	if(s==1 and s==2):
		print 2
		print "0 1"
	else:
		print 3
		print 0,k-1,s-k

class Main:
	s=raw_input().split(" ")
	l=[int(x) for x in s]
	s=l[0]
	k=l[1]
	if(s<k):
		print 2
		print s,"0"
	elif(k==2):
		print "2"
		print s,"0"
	else:
		x=s-k
		l1=[]
		t=0
		while(x!=0):
			l1.append(x)
			t+=1
			x=x/4
		print t
		s1=''
		for x in l1:
			s1=s1+str(x)+" "
		print s1

l = [0,1]
s,k = map(int,raw_input().split())
while 1:
    t = sum(l if len(l) < k else l[-1:-1-k:-1])
    if t >= s: break
    l.append(t)
r = []
for i in xrange(len(l)-1,-1,-1):
    if s == 0:
        if len(r) < 2: r.append(0)
        break
    elif s >= l[i]:
        r.append(l[i])
        s -= l[i]
print len(r)
print ' '.join(map(str,r))

d = {}
def gen_kbs(k, n):
    if n < k:
        return 0
    if n == k:
        return 1
    if n in d:
        return d[n]
    return sum(gen_kbs(k, i) for i in xrange(n - k, n))
s, k = map(int, raw_input().split())
i = k
kbs = []
while True:
    v = gen_kbs(k, i)
    d[i] = v
    if v >= s:
        break
    kbs.append(v)
    i += 1
count = 0
kbs = reversed(sorted(set(kbs)))
ans = []
for v in kbs:
    if s == 0:
        break
    if v == 0:
        continue
    if s >= v:
        ans.append(v)
        s -= v
ans = map(str, ans)
print len(ans)
print ' '.join(ans)

d = {}
def gen_kbs(k, n):
    if n < k:
        return 0
    if n == k:
        return 1
    if n in d:
        return d[n]
    return sum(gen_kbs(k, i) for i in xrange(n - k, n))
s, k = map(int, raw_input().split())
i = k - 1
kbs = []
while True:
    v = gen_kbs(k, i)
    d[i] = v
    if v != 2 and v >= s:
        break
    kbs.append(v)
    i += 1
count = 0
kbs = reversed(sorted(set(kbs)))
ans = []
for v in kbs:
    if s == 0 and len(ans) >= 2:
        break
    if s >= v:
        ans.append(v)
        s -= v
ans = map(str, ans)
print len(ans)
print ' '.join(ans)

d = {}
def gen_kbs(k, n):
    if n < k:
        return 0
    if n == k:
        return 1
    if n in d:
        return d[n]
    return sum(gen_kbs(k, i) for i in xrange(n - k, n))
s, k = map(int, raw_input().split())
i = k - 1
kbs = []
while True:
    v = gen_kbs(k, i)
    d[i] = v
    if v >= s:
        break
    kbs.append(v)
    i += 1
count = 0
kbs = reversed(sorted(set(kbs)))
ans = []
for v in kbs:
    if s == 0:
        break
    if v == 0:
        continue
    if s >= v:
        ans.append(v)
        s -= v
ans = map(str, ans)
print len(ans)
print ' '.join(ans)

d = {}
def gen_kbs(k, n):
    if n < k:
        return 0
    if n == k:
        return 1
    if n in d:
        return d[n]
    return sum(gen_kbs(k, i) for i in xrange(max(n - k, k - 1), n))
s, k = map(int, raw_input().split())
i = k - 1
kbs = []
while True:
    v = gen_kbs(k, i)
    d[i] = v
    if v != 2 and v != 1 and v >= s:
        break
    kbs.append(v)
    i += 1
count = 0
kbs = reversed(sorted(set(kbs)))
ans = []
for v in kbs:
    if s == 0 and len(ans) >= 2:
        break
    if s >= v:
        ans.append(v)
        s -= v
ans = map(str, ans)
print len(ans)
print ' '.join(ans)

d = {}
def gen_kbs(k, n):
    if n < k:
        return 0
    if n == k:
        return 1
    if n in d:
        return d[n]
    return sum(gen_kbs(k, i) for i in xrange(n - k, n))
s, k = map(int, raw_input().split())
i = k
kbs = []
while True:
    v = gen_kbs(k, i)
    d[i] = v
    if v >= s:
        break
    kbs.append(v)
    i += 1
count = 0
kbs = reversed(sorted(kbs))
ans = []
for v in kbs:
    if s == 0:
        break
    if v == 0:
        continue
    if s >= v:
        ans.append(v)
        s -= v
ans = map(str, ans)
print len(ans)
print ' '.join(ans)

s,k=map(int,raw_input().split())
t={}
def f(a,b):
    s=0
    if b < a:  s=0
    elif b == a: s=1
    elif b in t:
        s=t[b]
    elif a > 32: s=2**(b-a-1)
    else:
        for i in range(b-a,b):
            s+=f(a,i)
    t[b] = s
    return s

i=0
e=0
F=[]
while e < s:
    i+=1
    e=f(k,i)
    F+=[e]

r=[]
for e in reversed(F):
    if e <= s and e:
        r+=[`e`]
        s-=e
print len(r)
print ' '.join(r)

s,k=map(int,raw_input().split())
t={}
def f(a,b):
    s=0
    if b < a:  s=0
    elif b == a: s=1
    elif b in t:
        s=t[b]
    elif a > 32: s=2**(b-a-1)
    else:
        for i in range(b-a,b):
            s+=f(a,i)
    t[b] = s
    return s

i=0
e=0
F=[]
while e < s:
    i+=1
    e=f(k,i)
    if e < s:
        F+=[e]

r=[]
for e in reversed(F):
    if e <= s and e:
        r+=[`e`]
        s-=e
print len(r)
print ' '.join(r)

def first_fib(s,k):
    bon = [0,1]
    summ = 0
    while summ < s:
        summ = 0
        if len(bon) < k: count = len(bon)
        else: count = k
        last = bon.index(max(bon))
        summ = sum(bon[-count:-1])+bon[last]
        bon.append(summ)
    del bon[last+1]
    return bon
bon = [0]
i = 0
s,k = map(int,raw_input().split())
if s == 1: print "2" + "\n" + "1 0"
elif s == 2: print "2" + "\n" + "1 1"
elif s == 3: print "2" + "\n" + "1 2"
elif s == 4: print "2" + "\n" + "2 2"
else:
    if k<32: bon = first_fib(s,k)
    else:
        while (2**i) < s:
            bon.append(2**i)
            i+=1
    arr = []
    while s != 0:
        if s >= bon[-1]:
            s-=bon[-1]
            arr.append(bon.pop())
        else:
            del bon[-1]
    l = len(arr)
    print l
    print ' '.join(map(str,arr))

s, k = map(int, raw_input().split())
a = [0] * k + [1]
while a[-1] < s:
	a.append(sum(a[-k : ]))
r = [`0`]
for x in a[ : k : -1]:
	if s >= x:
		s -= x
		r.append(`x`)
print len(r)
print ' '.join(r)

import bisect

def start():
    s, k = map(int, raw_input().split())
    kbonacci = [0]*(k-1)
    kbonacci.append(1)
    i = k
    while kbonacci[i-1] < s:
        kbonacci.append(sum(kbonacci[i-k:i]))
        i = i+1
    summr = [0]
    while s > 0:
        bl = bisect.bisect_left(kbonacci,s)
        if kbonacci[bl] == s:
            summr.append(s)
            break
        else:
           s = s-kbonacci[bl-1]
           summr.append(kbonacci[bl-1])
    for x in summr:
        print x,

start()

n, k = map(int, raw_input().split())

bona = [1]

cnt = 0

while bona[-1] < n:
    if cnt < k:
        bona.append(2 ** cnt)
    else:
        bona.append(2 ** cnt - bona[cnt - k])
    cnt += 1

ans = []

while n > 0:
    while bona[-1] > n:
        bona.pop()
    ans.append(bona[-1])
    n -= bona[-1]

if len(ans) == 1:
    ans.append(0)

print len(ans)
print ' '.join(map(str, ans))

n, k = map(int, raw_input().split())

bona = [1]

cnt = 0

while bona[-1] < n:
    if cnt < k:
        bona.append(2 ** cnt)
    else:
        bona.append(2 ** cnt - bona[cnt - k])
    cnt += 1

ans = []

while n > 0:
    while bona[-1] > n:
        bona.pop()
    ans.append(bona[-1])
    n -= bona[-1]

print len(ans)
print ' '.join(map(str, ans))

fibarr = []
dp = []
predecessor = []
def gen_list(s, k):
    global fibarr

    fibarr = [0 for _ in xrange(k-1)]
    fibarr.append(1)
    fibarr.append(1)
    idx = k + 1
    while fibarr[idx - 1] <= s :
        fibarr.append(fibarr[idx-1] * 2 - fibarr[idx - k - 1])
        idx += 1

if __name__ == '__main__':
    int_s, int_k = map(int, raw_input().split())

    gen_list(int_s, int_k)
    int_rem = int_s
    answer = []
    for ii in xrange(0, len(fibarr)) :
        if int_rem == 0 :
            break
        if (fibarr[ii] > int_rem) :
            continue
        else :
            int_rem -= fibarr[ii]
            answer.append(fibarr[ii])

    print len(answer)
    res = ""
    for item in answer :
        res+=str(item)+" "
    res = res[0:len(res)-1]
    print res
    pass

fibarr = []
dp = []
predecessor = []
def gen_list(s, k):
    global fibarr

    fibarr = [0 for _ in xrange(k-1)]
    fibarr.append(1)
    fibarr.append(1)
    idx = k + 1
    while fibarr[idx - 1] <= s :
        fibarr.append(fibarr[idx-1] * 2 - fibarr[idx - k - 1])
        idx += 1

if __name__ == '__main__':
    int_s, int_k = map(int, raw_input().split())

    gen_list(int_s, int_k)
    int_rem = int_s
    answer = []
    for ii in xrange(len(fibarr)-1, 0, -1) :
        if int_rem == 0 :
            break
        if (fibarr[ii] > int_rem) :
            continue
        else :
            int_rem -= fibarr[ii]
            answer.append(fibarr[ii])

    print len(answer)
    res = ""
    for item in answer :
        res+=str(item)+" "
    res = res[0:len(res)-1]
    print res
    pass

#coding=utf-8

def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

#for i in range(1,20):
#	for j in range(1,20):
#		print "%3d"%F(i,j),
#	print

def Gen_F(k,MAX):
	if k == 1:
		return [0,1]
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb < MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L

s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)

#print [F(k,i) for i in range(k,k+20)]
#print FL

FL = list(reversed(sorted(FL)))

#print FL
ans = [0]
while s != 0:
	for i in FL:
		if s >= i:
			ans.append(i)
			s = s - i
			break;

print len(ans)
for i in ans:
	print i,
print

#coding=utf-8

def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

def Gen_F(k,MAX):
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb < MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L
s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)
FL = list(reversed(sorted(FL)))
#print FL
ans = []
while s != 0:
	for i in FL:
		if s >= i:
			ans.append(i)
			s = s - i
			break;

print len(ans)
for i in ans:
	print i,
print

#coding=utf-8

def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

#for i in range(1,20):
#	for j in range(1,20):
#		print "%3d"%F(i,j),
#	print

def Gen_F(k,MAX):
	if k == 1:
		return [0,1]
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb < MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L

s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)

#print [F(k,i) for i in range(k,k+20)]
#print FL

FL = list(reversed(sorted(FL)))

#print FL

ans = []
for i in FL:
	if s >= i:
		ans.append(i)
		s = s - i

print len(ans)
for i in ans:
	print i,
print

#coding=utf-8

def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

def Gen_F(k,MAX):
	if k == 1:
		return [0,1]
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb < MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L
s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)
FL = list(reversed(sorted(FL)))
#print FL
ans = [0]
while s != 0:
	for i in FL:
		if s >= i:
			ans.append(i)
			s = s - i
			break;

print len(ans)
for i in ans:
	print i,
print

#coding=utf-8

def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

#for i in range(1,20):
#	for j in range(1,20):
#		print "%3d"%F(i,j),
#	print

def Gen_F(k,MAX):
	if k == 1:
		return [0,1]
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb < MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L

s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)
FL = list(reversed(sorted(FL)))
#print [F(k,i) for i in range(1,20)]
#print FL
ans = [0]
while s != 0:
	for i in FL:
		if s >= i:
			ans.append(i)
			s = s - i
			break;

print len(ans)
for i in ans:
	print i,
print

#coding=utf-8

#import Set
def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

#for i in range(1,20):
#	for j in range(1,20):
#		print "%3d"%F(i,j),
#	print

def Gen_F(k,MAX):
	if k == 1:
		return [0,1]
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb < MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L

s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)

#print [F(k,i) for i in range(k,k+20)]
#print FL

FL = list(reversed(sorted(list(set(FL)))))

#print FL

ans = []
for i in FL:
	if s >= i:
		#print s,i
		ans.append(i)
		s = s - i

print len(ans)
for i in ans:
	print i,
print

#coding=utf-8

#import Set
def F(k,n):
	if 1 <= n and n < k:
		return 0
	if n == k:
		return 1
	return sum([F(k,i) for i in range(n-k,n)])

#for i in range(1,20):
#	for j in range(1,20):
#		print "%3d"%F(i,j),
#	print

def Gen_F(k,MAX):
	if k == 1:
		return [0,1]
	L = [0,1]
	l = -k + 2
	kb = 1
	while kb <= MAX:
#		print kb,l,l+k
		L.append(kb)
		kb = kb * 2
		if l >= 0:
			kb = kb - L[l]
		l = l + 1
	return L

s,k = map(int, raw_input().split())
FL =  Gen_F(k,s)

print [F(k,i) for i in range(k,k+20)]
print FL

FL = list(reversed(sorted(list(set(FL)))))

#print FL

ans = []
for i in FL:
	if s >= i:
		#print s,i
		ans.append(i)
		s = s - i

print len(ans)
for i in ans:
	print i,
print

s, k = map(int, raw_input().split())
l = [0, 1]
while True:
    l.append(sum(l[-k:]))
    if (l[-1] > s):
        l = l[:-1]
        break
print '#', s, l
ans = []
for i in l[::-1]:
    if s >= i:
        s -= i
        ans.append(i)

print len(ans)
print ' '.join(map(str, ans))

s, k = map(int, raw_input().split())
l = [0, 1]
while True:
    l.append(sum(l[-k:]))
    if (l[-1] >= s):
        l = l[:-1]
        break
#print '#', s, l
ans = []
for i in l[::-1]:
    if s >= i:
        s -= i
        ans.append(i)
#print '#', sum(ans), s
print len(ans)
print ' '.join(map(str, ans))

myin = raw_input()
myin = myin.split()

mysum = int(myin[0])
myk = int(myin[1])

kbon = [0,] * (myk - 1)
kbon.append(1)

while kbon[len(kbon) - 1] < mysum:
    temp = 0
    for i in range(myk):
        temp += kbon[len(kbon) - 1 - i]
    kbon.append(temp)

myout = []

mysumtemp = mysum

for i in range(len(kbon) - 2, -1, -1):
    if kbon[i] == 0:
        break
    if kbon[i] <= mysumtemp:
        myout.append(kbon[i])
        mysumtemp -= kbon[i]

print len(myout) + 1
outtemp = ''
for i in myout:
    outtemp += str(i) + ' '

outtemp = outtemp[:len(outtemp) - 1]
print outtemp + ' 0'

myin = raw_input()
myin = myin.split()

mysum = int(myin[0])
myk = int(myin[1])

kbon = [0,] * (myk - 1)
kbon.append(1)

while kbon[len(kbon) - 1] < mysum:
    temp = 0
    for i in range(myk):
        temp += kbon[len(kbon) - 1 - i]
    kbon.append(temp)

myout = []

mysumtemp = mysum

for i in range(len(kbon) - 2, -1, -1):
    if kbon[i] == 0:
        break
    if kbon[i] <= mysumtemp:
        myout.append(kbon[i])
        mysumtemp -= kbon[i]

print len(myout)
outtemp = ''
for i in myout:
    outtemp += str(i) + ' '

outtemp = outtemp[:len(outtemp) - 1]
print outtemp + ' 0'

# -*- coding: utf-8 -*-

from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import nested_scopes
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement

import bisect
import collections
import copy
import functools
import heapq
import itertools
import math
import operator
import os
import re
import random
import sys
from pprint import pprint

__author__ = 'Aphrodite'

def main():
    iterator = itertools.imap(str.rstrip, sys.stdin.readlines())
    s, k = map(int, next(iterator).split())
    a = [0] * (k - 1)
    a.append(1)
    while a[-1] < s:
        a.append(sum(a[-k:]))
#    print(a)
    res = []
    while s > 0:
        idx = bisect.bisect(a, s) - 1
        s -= a[idx]
        res.append(a[idx])
    print(len(res))
    print(' '.join(map(str, res)))

if __name__ == '__main__':
    main()

s, k = map(int, raw_input().split())
sums, sequence = 1, [1]
while sums <= s:
    sequence.append(sums)
    sums += sums
    if len(sequence) > k:
        sums -= sequence[-(k + 1)]
result = []
for i in reversed(sequence):
    if i <= s:
        s -= i
        result.append(i)
print len(result)
print " ".join(map(str, result))

s, k = map(int, raw_input().split())
sums, sequence = 1, [1]
while sums < s:
    sequence.append(sums)
    sums += sums
    if len(sequence) > k:
        sums -= sequence[-(k + 1)]
result = []
for i in reversed(sequence):
    if i <= s:
        s -= i
        result.append(i)
print len(result)
print " ".join(map(str, result))

#import sys
#
#sys.stdin = open('in.txt', 'r')

s, k = map(int, raw_input().split())
fib = [0, 1, 1]

while(True):
    fib.append(sum(fib[-k:]))
    if fib[-1] >= s:
        del fib[-1]
        break

ans = []

while(True):
    x = fib.pop()
    if x <= s:
        s -= x
        ans.append(x)
    if s == 0:
        break
ans.append(0)
print len(ans)
print ' '.join(map(str, ans))

#import sys
#
#sys.stdin = open('in.txt', 'r')

s, k = map(int, raw_input().split())
fib = [0] * k + [1]

while(True):
    fib.append(sum(fib[-k:]))
    if fib[-1] >= s:
        del fib[-1]
        break

ans = []

while(True):
    x = fib.pop()
    if x <= s:
        s -= x
        ans.append(x)
    if s == 0:
        break
print len(ans)
print ' '.join(map(str, ans))

def readInt():
    return tuple([int(x) for x in raw_input().split()])

s, k = readInt()
fib = [0] * (k - 1) + [1]
while fib[-1] < s:
    fib.append(sum(fib[-k:]))
ans = []
while s > 0:
    if fib[-1] <= s:
        ans.append(str(fib[-1]))
        s -= fib[-1]
    fib.pop()
print len(ans)
print " ".join(ans)

import bisect
s,k=list(map(int,input().split()))
f=[0]*45
for i in range(45):
    if i<k:
        f[i]=i*(i+1)//2
    else:
        f[i]=sum([f[i-j] for j in range(1,k+1)])
ans=[0]
while s>0:
    i=bisect.bisect_right(f,s)
    ans.append(f[i-1])
    s=s-f[i-1]
print(len(ans))
for i in range(len(ans)):
    print(ans[i],end=' ')

s,k=map(int,input().split())
arr=[0];k1=0;visited=[];mini=0
while(1):
    k1+=1
    if(k1==k):arr.append(1);
    elif(k1<k):arr.append(0);
    else:
        sum1=0
        for i in range(k1-1,k1-k-1,-1):
            sum1+=arr[i]
        if(sum1>=s):break;
        arr.append(sum1)
while(s>0):
    for i in arr:
        if(i<=s):mini=i;
        else:break;
    s-=mini;visited.append(mini);
if(len(visited)==0):visited.append(0);
print(len(visited))
print(*visited)

s,k=map(int,input().split())
arr=[0];k1=0;visited=[];mini=0
while(1):
    k1+=1
    if(k1==k):arr.append(1);
    elif(k1<k):arr.append(0);
    else:
        sum1=0
        for i in range(k1-1,k1-k-1,-1):
            sum1+=arr[i]
        if(sum1>=s):break;
        arr.append(sum1)
while(s>0):
    for i in arr:
        if(i<=s):mini=i;
        else:break;
    s-=mini;visited.append(mini);
print(len(visited))
print(*visited)

def power(a, b):
    if b == 0:
        return 1
    elif b % 2 == 0:
        a_1 = a * a
        return pow(a_1, b // 2)
    return a * pow(a, b - 1)

def k_fib(s, k):
    result = list()
    if k >= 40:
        fibs = [power(2, i) for i in range(40)]
    else:
        fibs = [0] * (k - 1) + [1]
        while fibs[len(fibs) - 1] < s:
            fibs.append(sum(fibs[-k:]))
    while s > 0:
        if fibs[len(fibs) - 1] <= s:
            result.append(fibs[len(fibs) - 1])
            s -= fibs[len(fibs) - 1]
        fibs.pop()
    return result

S, K = [int(j) for j in input().split()]
print(len(k_fib(S, K)))
print(*k_fib(S, K))

"""
    Template written to be used by Python Programmers.
    Use at your own risk!!!!
    Owned by enraged(rating - 5 star at CodeChef and Specialist at Codeforces).
"""
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
# sys.setrecursionlimit(2*pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(var): sys.stdout.write(str(var))
def outln(var): sys.stdout.write(str(var)+"\n")
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

def k_bonacci(n):
    if n < k:
        return 0
    if n == k:
        return 1
    if n in dp.keys():
        return dp[n]
    dp[n] = 0
    for i in range(n-k, n):
        dp[n] += k_bonacci(i)
    return dp[n]

s, k = sp()
answer = []
if k <= 32:
    dp = dd(int)
    i = 1
    while True:
        dp[i] = k_bonacci(i)
        if dp[i] >= pow(10, 9):
            break
        i += 1
    arr = list(dp.values())
    while s > 0:
        temp = bl(arr, s)
        if arr[temp] > s:
            temp -= 1
        s -= arr[temp]
        answer.append(arr[temp])
else:
    i = 32
    while i >= 0 and s > 0:
        if pow(2, i) <= s:
            s -= pow(2, i)
            answer.append(pow(2, i))
        i -= 1
if len(answer) < 2:
    answer.insert(0, 0)
print(*answer)

s,k=map(int,input().split())
F = []
b = []
while k > 1:
    F.append(0)
    k -= 1
F.append(1)
k = len(F)
while True:
    f = sum(F[-k:])
    if f > s:
        break
    F.append(f)
for i in reversed(F):
    if i <= s:
        b.append(i)
        s -= i
print(len(b))
print (' '.join(map(str,b)))

n,k=map(int,input().split())
if n==2:
    print(2)
    print(0,2)
else:
    print(2)
    print(1,n-1)

def genkbon (s, k):
    if (k<50):
        i = 0
        res = [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
    if (k>=50):
        res = [0,1]
        i = 1
        while (res[i]<=s):
            res.append(2*res[i])
            i += 1
        print(res)
        return res

def solve(s, k, tmp):
    tmp2 = tmp
    while (tmp2[-1]>s):
        del tmp2[-1]
    if (s==0):
        return [0]
    if (s==1):
        return [0,1]
    if (s==2):
        return [0,2]
    ha = tmp2[-1]
    res = solve(s-ha,k,tmp2)
    return [ha]+res

inp1 = input()
inp = inp1.split()
hlp = genkbon(int(inp[0]),int(inp[1]))
sol = solve(int(inp[0]),int(inp[1]), hlp)
print(len(sol))
for i in sol[:-1]:
    print(i,end=' ')
print(sol[-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<3):
        return [0,s]
    tmp = genkbon (s, k)
    ha = tmp[-1]-tmp[-1-k]
    res = solve(s-ha,k)
    return tmp[-1-k+1:-1]+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])

def genFib(k, n):
    cur = 1
    ind = -k + 2
    ret = [0, 1]
    while cur < n:
        ret.append(cur)
        cur += cur
        if ind >= 0:
            cur -= ret[ind]
        ind += 1
    return ret

def get(n, cur, last):
    global f, m
    if n == 0:
        cur.append(0)
        print len(cur)
        print ' '.join(map(str, cur))
        exit(0)
    for i in range(last, m):
        x = f[i]
        if x <= n:
            get(n - x, cur + [x], i + 1)

n, k = map(int, raw_input().split())
f = genFib(k, n)[::-1]
m = len(f)
get(n, [], 0)
exit(1)

def genFib(k, n):
    cur = 1
    ind = -k + 2
    ret = [0, 1]
    while cur < n:
        ret.append(cur)
        cur += cur
        if ind >= 0:
            cur -= ret[ind]
        ind += 1
    return ret

def get(n, cur):
    global f
    if n == 0:
        cur.append(0)
        print len(cur)
        print ' '.join(map(str, cur))
        exit(0)
    for x in f:
        if x <= n and x not in cur:
            get(n - x, cur + [x])

n, k = map(int, raw_input().split())
f = genFib(k, n)[::-1]
get(n, [])

import sys
if sys.version_info[0] == 2: input = raw_input
s, k = map(int,input().split())
if s == 1:
    print('2\n0 1')
    sys.exit(0)
elif s==2:
    print('2\n0 2')
    sys.exit(0)
n = 2
ans = []
a = [0] * 100
a[0] = a[1] = 1
while a[n-1] < s:
    a[n] = 2*a[n-1]-(a[n-k-1] if n-k-1>=0 else 0)
    n += 1

for i in range(n-1,-1,-1):
    if a[i] <= s:
        ans.append(a[i])
        s -= a[i]
        if s == 0: break
print(len(ans) + 2)
print('0 0 ' + " ".join(map(str,ans)))

s,k=map(int,raw_input().split())
a,b=[1],[]
while a[-1]<s:
  a.append(sum(a[-k:]))
for i in reversed(a[:-1]):
  if i<=s:
    b.append(i)
    s-=i
print len(b)
print ' '.join(map(str,b))

s,k=map(int,raw_input().split())
a,b=[1],[]
while a[-1]<s:
  a.append(sum(a[-k:]))
for i in reversed(a[:-1]):
  if i<=s:
    b.append(i)
    s-=i
print ' '.join(map(str,b))

s, k = map(int, raw_input().split())
F = [1]
total = 1
while len(F) < k and total <= s:
    val = F[-1]
    if total + val <= s:
        F.append(total + val)
        total += val
    else:
        break

total = sum(F)
while total <= s:
    val = sum(F[-k:])
    F.append(val)
    total += val

C = []
F = F[::-1]
def find_recur(n):
    if n > 0:
        if n in F:
            C.append(n)
        else:
            x = next(x for x in F if x < n)
            if x is not None:
                C.append(x)
                y = find_recur(n - x)
                if y is not None:
                    C.append(y)
    return None
if s in F:
    print 2
    print 0, s
    exit()
else:
    find_recur(s)
    print " ".join(map(str, C))

s, k = map(int, raw_input().split())
A = [1, 2, 3]
total = 6
while total <= s:
    num = A[-1] + A[-2]
    A.append(num)
    total += num

if total == s:
    print len(A)
    print " ".join(map(str, A))
else:
    extra = total - s
    import bisect
    for i in xrange(len(A)):
        n1 = A[i]
        n2 = extra - A[i]
        if n2 == 0:
            A[i] = ''
            print " ".join(map(str, filter(lambda x: x!='',A)))
            break
        else:
            pos = bisect.bisect_left(A,n2,i+1)
            if pos != len(A) and A[pos] == n2:
                A[i] = ''
                A[pos] = ''
                print " ".join(map(str, filter(lambda x: x!='',A)))
                break

s, k = map(int, raw_input().split())
F = [1]
total = 1
while len(F) < k and total <= s:
    val = F[-1]
    if total + val <= s:
        F.append(total + val)
        total += val
    else:
        break

total = sum(F)
while total <= s:
    val = sum(F[-k:])
    F.append(val)
    total += val

C = []
F = F[::-1]
def find_recur(n):
    if n > 0:
        if n in F:
            C.append(n)
        else:
            x = next(x for x in F if x < n)
            if x is not None:
                C.append(x)
                y = find_recur(n - x)
                if y is not None:
                    C.append(y)
    return None
if s in F:
    print 2
    print 0, s
    exit()
else:
    find_recur(s)
    print(len(C))
    print " ".join(map(str, C))

s, k = map(int, raw_input().split())
A = [1, 2, 3]
total = 6
while total <= s:
    num = A[-1] + A[-2]
    A.append(num)
    total += num

if total == s:
    print len(A)
    print " ".join(map(str, A))
else:
    extra = total - s
    import bisect
    for i in xrange(len(A)):
        n1 = A[i]
        n2 = extra - A[i]
        pos = bisect.bisect_left(A,n2,i+1)
        if pos != len(A) and A[pos] == n2:
            A[i] = ''
            A[pos] = ''
            print " ".join(map(str, filter(lambda x: x!='',A)))
            break

s, k = map(int, raw_input().split())
A = [1, 2, 3]
total = 6
while total <= s:
    num = A[-1] + A[-2]
    A.append(num)
    total += num

if total == s:
    print len(A)
    print " ".join(map(str, A))
else:
    extra = total - s
    import bisect
    for i in xrange(len(A)):
        n1 = A[i]
        n2 = extra - A[i]
        if n2 == 0:
            A[i] = ''
            print len(A)-1
            print " ".join(map(str, filter(lambda x: x!='',A)))
            break
        else:
            pos = bisect.bisect_left(A,n2,i+1)
            if pos != len(A) and A[pos] == n2:
                A[i] = ''
                A[pos] = ''
                print len(A)-2
                print " ".join(map(str, filter(lambda x: x!='',A)))
                break