#include <bits/stdc++.h>
using namespace std;
int sp(long long int n) {
  int sum = 0;
  while (n != 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  long long int n, b[100000];
  int no, i, k = 0;
  cin >> n;
  no = log10(n) + 1;
  no *= 9;
  for (i = n - no - 1; i <= n; i++) {
    if ((i + sp(i)) == n) b[k++] = i;
  }
  cout << k << endl;
  for (i = 0; i < k; i++) cout << b[i] << " ";
  return 0;
}
