#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  while (true) {
    string s;
    getline(cin, s);
    stringstream sa(s);
    int S = 0, K = 0;
    sa >> S >> K;
    if (S < 1) break;
    vector<int> v;
    v.push_back(1);
    v.push_back(1);
    int i = 2 - K;
    int n = 2;
    while (n <= S) {
      v.push_back(n);
      n *= 2;
      if (i >= 0) {
        n -= v[i];
      }
      ++i;
    }
    vector<int> ans;
    vector<int>::const_reverse_iterator it;
    for (it = v.rbegin(); it != v.rend(); ++it) {
      if (*it <= S) {
        ans.push_back(*it);
        S -= *it;
      }
    }
    if (ans.size() < 2) {
      ans.push_back(0);
    }
    sort(ans.begin(), ans.end());
    cout << ans.size() << endl;
    for (i = 0; i < ans.size(); ++i) {
      if (i) {
        cout << " ";
      }
      cout << ans[i];
    }
    cout << endl;
  }
  return 0;
}
