#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  cin >> x;
  int nd = 0;
  long long int temp = x;
  while (temp > 0) {
    nd++;
    temp /= 10;
  }
  vector<long long int> vans;
  for (int i = 0; i <= nd * 9; i++) {
    long long int nt = x - i;
    long long int sumt = 0;
    long long int xt = nt;
    while (xt > 0) {
      sumt += xt % 10;
      xt /= 10;
    }
    if (nt + sumt == x) {
      vans.push_back(nt);
    }
  }
  if (vans.size() == 0) {
    cout << 0;
    return 0;
  }
  int nz = vans.size();
  cout << nz << "\n";
  sort(vans.begin(), vans.end());
  for (int i = 0; i < nz; i++) {
    cout << vans[i] << "\n";
  }
  return 0;
}
