#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
  int i, j, k;
  cin >> N;
  set<int> ss;
  for (i = 0; i <= (9 * 9); i++) {
    int now = N - i;
    int sum = 0;
    sum += now;
    while (now > 0) {
      sum += (now % 10);
      now = now / 10;
    }
    if (sum == N) {
      ss.insert(N - i);
    }
  }
  cout << (int)ss.size() << "\n";
  if (ss.size() > 0) {
    for (set<int>::iterator it = ss.begin(); it != ss.end(); ++it) {
      cout << (*it) << " ";
    }
    cout << "\n";
  }
  return 0;
}
