#include <bits/stdc++.h>
using namespace std;
int SumDig(int x) {
  int ans = 0;
  while (x) {
    ans += (x % 10);
    x /= 10;
  }
  return ans;
}
vector<int> GetCount(int x) {
  vector<int> ans;
  for (int y = max(1, x - 1000000); y <= x; y++) {
    if (SumDig(y) + y == x) ans.push_back(y);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<int> ans = GetCount(n);
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) printf("%d\n", ans[i]);
}
