#include <bits/stdc++.h>
using namespace std;
long long cip(long long a) {
  long long r = 0;
  while (a > 0) {
    r = r + a % 10;
    a = a / 10;
  }
  return r;
}
int main() {
  long long n;
  vector<long long> R;
  cin >> n;
  for (long long i = max(1LL, n - 200); i <= n; i++) {
    if (i + cip(i) == n) R.push_back(i);
  }
  cout << R.size() << "\n";
  for (long long i = 0; i < R.size(); i++) {
    cout << R[i] << " ";
  }
}
