#include <bits/stdc++.h>
using namespace std;
int countNo(int n) {
  int x = 0;
  while (n != 0) {
    n /= 10;
    x++;
  }
  return x;
}
int countsum(int n) {
  int x = 0;
  while (n != 0) {
    x = x + (n % 10);
    n /= 10;
  }
  return x;
}
int main() {
  int n;
  cin >> n;
  int nu = countNo(n);
  int to = nu * 9 + 10;
  vector<int> out;
  for (int i = n - to; i <= n; i++) {
    if (i + countsum(i) == n) {
      out.push_back(i);
    }
  }
  cout << out.size() << '\n';
  for (int i = 0; i < (int)out.size(); i++) {
    cout << out[i] << " ";
  }
  return 0;
}
