#include <bits/stdc++.h>
using namespace std;
inline long long int sod(long long int x) {
  long long int ans = 0;
  while (x) {
    ans += x % 10;
    x /= 10;
  }
  return ans;
}
int main() {
  long long int n;
  cin >> n;
  vector<long long int> x;
  for (long long int i = max(1LL, n - 1000000); i <= n; i++) {
    if (i + sod(i) == n) x.push_back(i);
  }
  cout << x.size() << endl;
  for (auto &it : x) cout << it << endl;
  return 0;
}
