#include <bits/stdc++.h>
using namespace std;
int main() {
  long long s, k;
  cin >> s >> k;
  vector<long long> F;
  F.push_back(0);
  F.push_back(1);
  while (F.back() < 1.1e9) {
    int l = F.size();
    F.push_back(0);
    for (int i = max(0, l - (int)k); i <= l - 1; i++) {
      F[l] += F[i];
    }
  }
  vector<int> ans;
  long long last = -1;
  for (int i = (int)F.size() - 1; i >= 0; i--) {
    if (s >= F[i] && last != F[i]) {
      s -= F[i];
      ans.push_back(F[i]);
      last = F[i];
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (auto x : ans) {
    cout << x << " ";
  }
  cout << endl;
  return 0;
}
