#include <bits/stdc++.h>
using namespace std;
const long long MAX = 10000;
set<long long> S;
int main() {
  long long n, nn, x, x1, x2, k, s = 0;
  cin >> n;
  nn = n;
  k = 0;
  while (nn != 0) {
    k++;
    nn /= 10;
  }
  for (int i = k; i > 0; i--) {
    for (int j = i * 9; j >= i; j--) {
      s = 0;
      x = n - j;
      x1 = x;
      while (x1 != 0) {
        s += x1 % 10;
        x1 /= 10;
      }
      if (s == j) S.insert(x);
    }
  }
  cout << S.size() << endl;
  for (auto it = S.begin(); it != S.end(); it++) cout << *it << endl;
  return 0;
}
