#include <bits/stdc++.h>
using namespace std;
long long n;
bool cek(long long a, long long b) {
  long long sal = a;
  while (sal > 0) {
    a += sal % 10;
    sal /= 10;
  }
  return a == b;
}
int main() {
  cin >> n;
  vector<long long> ans;
  for (long long i = n; i > max(n - 2000, (long long)0); i--) {
    if (cek(i, n)) ans.push_back(i);
  }
  cout << ans.size() << endl;
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
