#include <bits/stdc++.h>
using namespace std;
int degree(int n) {
  int d = 1;
  while (n) {
    n /= 10;
    d++;
  }
  return d;
}
int main() {
  int n;
  cin >> n;
  vector<int> v;
  int d = degree(n);
  int maxl = 9 * d;
  for (int i = n - 1; i >= n - maxl; i--) {
    int sum = 0;
    int temp = i;
    while (temp) {
      sum += temp % 10;
      temp = temp / 10;
    }
    sum += i;
    if (sum == n) v.push_back(i);
  }
  sort(v.begin(), v.end());
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
  return 0;
}
