#include <bits/stdc++.h>
using namespace std;
long long dig_sum(long long i) {
  long long sm = i;
  while (i > 0) {
    sm += i % 10;
    i = i / 10;
  }
  return sm;
}
int32_t main() {
  long long n;
  cin >> n;
  long long dig = 0;
  long long temp = n;
  while (temp > 0) {
    dig++;
    temp /= 10;
  }
  long long start = ((n - 9 * dig) > 0) ? (n - 9 * dig) : 0;
  long long count = 0;
  vector<long long> val;
  for (long long i = start; i <= n; i++) {
    if (dig_sum(i) == n) {
      count++;
      val.push_back(i);
    }
  }
  cout << count << endl;
  for (long long i : val) {
    cout << i << endl;
  }
  return 0;
}
