#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = 0; i < (int)(1000); i++) {
    int k = n - i;
    if (k < 0) break;
    int t = n - i;
    while (t) {
      k += t % 10;
      t /= 10;
    }
    if (n == k) ans.push_back(n - i);
  }
  sort((ans).begin(), (ans).end());
  cout << ans.size() << endl;
  for (int u : ans) cout << u << endl;
  return 0;
}
