#include <bits/stdc++.h>
using namespace std;
int s, k;
long long f[10005];
int main(int ac, char **av) {
  cin >> s >> k;
  f[0] = 1;
  int t;
  for (int i = 1;; ++i) {
    for (int j = 1; j <= k; ++j) {
      if (i < j) break;
      f[i] += f[i - j];
    }
    t = i;
    if (f[i] >= s) break;
  }
  vector<int> res;
  for (; t >= 0; --t)
    if (s >= f[t]) {
      res.push_back(f[t]);
      s -= f[t];
      if (!s) break;
    }
  if (res.size() < 2) res.push_back(0);
  cout << res.size() << endl;
  for (int i = 0; i < res.size(); ++i) cout << res[i] << " ";
  return 0;
}
