#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, k;
  cin >> s >> k;
  vector<long long> f(50);
  f[0] = 0;
  f[1] = 1;
  for (int i = 2; i < 50; i++)
    for (int j = 1; j <= k && j <= i; j++) f[i] += f[i - j];
  vector<int> ans;
  int t = 1;
  while (f[t] < s) t++;
  for (int i = t; i >= 0; i--)
    if (f[i] <= s) {
      ans.push_back(f[i]);
      s -= f[i];
    }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++)
    printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
  return 0;
}
