#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, i, j, c, cc;
  cin >> n;
  vector<long long> v;
  x = n - 81;
  if (x < 0) {
    x = 0;
  }
  for (i = x; i <= n; i++) {
    c = i;
    cc = 0;
    while (c > 0) {
      long long d = c % 10;
      cc += d;
      c /= 10;
    }
    if (cc + i == n) {
      v.push_back(i);
    }
  }
  cout << v.size() << endl;
  int f = 0;
  for (int ii = 0; ii < v.size(); ii++) {
    cout << v[ii] << " ";
    f = 1;
  }
  if (f) {
    cout << endl;
  }
  return 0;
}
