#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
int main() {
  long long int k;
  cin >> k;
  v.clear();
  for (int i = 0; i <= 90; i++) {
    long long int p = k - i;
    long long int val = p;
    long long int sum = p;
    while (p) {
      sum += p % 10;
      p /= 10;
    }
    if (sum == k) {
      v.push_back(val);
    }
  }
  cout << v.size() << endl;
  for (int i = v.size() - 1; i >= 0; i--) {
    cout << v[i] << " ";
  }
  return 0;
}
