#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int main() {
  long long n, temp, sum;
  cin >> n;
  temp = n;
  int cnt = 0;
  while (temp) {
    cnt++;
    temp /= 10;
  }
  for (long long i = n - (cnt * 9); i <= n; i++) {
    temp = i;
    sum = i;
    while (temp) {
      sum += temp % 10;
      temp /= 10;
    }
    if (sum == n) v.push_back(i);
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
