#include <bits/stdc++.h>
using namespace std;
long long a[1000 * 10];
int main() {
  long long n, j = 0, d = 10000, dd = 0;
  cin >> n;
  long long x = max(n - d, dd);
  for (long long i = n; i > x; i--) {
    long long s = i;
    long long u = i;
    for (;;) {
      s += u % 10;
      u /= 10;
      if (u == 0) break;
    }
    if (s == n) {
      a[j] = i;
      j++;
    }
  }
  cout << j << endl;
  for (int i = j - 1; i >= 0; i--) cout << a[i] << endl;
}
