#include <bits/stdc++.h>
using namespace std;
int main() {
  int s, k;
  scanf("%d%d", &s, &k);
  long long a[110] = {};
  a[0] = 1;
  for (int i = 1; a[i - 1] < s; i++) {
    int sum = 0;
    for (int j = max(0, i - k); j < i; j++) sum += a[j];
    a[i] = sum;
  }
  vector<long long> v;
  while (s > 0) {
    int ii = 0;
    for (int i = 0; a[i] > 0 && a[i] <= s; i++) ii = i;
    s -= a[ii];
    v.push_back(a[ii]);
  }
  if (v.size() <= 1) v.push_back(0);
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
