#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, p, q, count;
  vector<long long> v;
  cin >> n;
  for (i = max((long long)0, n - 90); i <= n; i++) {
    p = i;
    q = i;
    count = 0;
    while (q > 0) {
      count += q % 10;
      q /= 10;
    }
    if (p + count == n) v.push_back(p);
  }
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
}
