#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  long long sum = 0;
  long long num = n;
  while (num > 0) {
    sum += num % 10;
    num /= 10;
  }
  return n + sum;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> ans;
  for (int i = n; i >= n - 2000 and i >= 0; i--) {
    if (f(i) == n) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << "\n";
  sort(ans.begin(), ans.end());
  for (auto val : ans) cout << val << "\n";
}
