#include <bits/stdc++.h>
using namespace std;
long long fib[65];
vector<long long> ans;
long long s, k;
int main() {
  cin >> s >> k;
  fib[0] = 1;
  int maxn = 1;
  for (int i = 1; i < 60; i++) {
    for (int j = i - 1; i - j <= k && j >= 0; j--) {
      fib[i] += fib[j];
    }
    maxn = i;
    if (fib[i] < 0) {
      maxn = i - 1;
      break;
    }
  }
  for (int i = maxn; i >= 0; i--) {
    if (s == fib[i]) {
      ans.push_back(0);
      ans.push_back(fib[i]);
      break;
    }
    if (s > fib[i]) {
      ans.push_back(fib[i]);
      s -= fib[i];
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
}
