#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, temp, sum = 0;
  vector<long long> adj;
  cin >> n;
  for (int x = 0; x <= 80; x++) {
    temp = n - x;
    sum = 0;
    while (temp > 0) {
      sum += temp % 10;
      temp /= 10;
    }
    if (sum == x) {
      adj.push_back(n - x);
    }
  }
  cout << adj.size() << '\n';
  sort(adj.begin(), adj.end());
  for (int i = 0; i < adj.size(); i++) {
    cout << adj[i] << '\n';
  }
  return 0;
}
