#include <bits/stdc++.h>
using namespace std;
int sumDigits(int x) {
  int sum = 0;
  while (x > 0) {
    sum += x % 10;
    x = x / 10;
  }
  return sum;
}
int main() {
  int n;
  cin >> n;
  if (n <= 1) {
    cout << 0 << endl;
    return 0;
  }
  stack<int> result;
  int d = 0;
  int x = n;
  while (x > 0) {
    d++;
    x /= 10;
  }
  x = n;
  int target = n - d * 9;
  do {
    int temp = x + sumDigits(x);
    if (temp == n) result.push(x);
    x--;
  } while (x >= 0 && x >= target);
  cout << result.size() << endl;
  while (!result.empty()) {
    cout << result.top() << endl;
    result.pop();
  }
  return 0;
}
