#include <bits/stdc++.h>
using namespace std;
long long int getsum(long long int n) {
  long long s = 0;
  while (n != 0) {
    s += n % 10;
    n /= 10;
  }
  return s;
}
int main() {
  long long int n;
  cin >> n;
  vector<long long int> v;
  for (long long int i = 1; i <= 100 && i < n; i++) {
    if (getsum(n - i) == i) v.push_back(n - i);
  }
  sort(v.begin(), v.end());
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); i++) cout << v[i] << "\n";
}
