#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int MAXN = 1e5 + 5;
const long long MOD = 1e9 + 7;
std::vector<int> ve;
long long js(int nn) {
  long long ans = nn;
  while (nn) {
    ans += nn % 10;
    nn = nn / 10;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  if (n < 1000) {
    for (int i = 0; i < n; i++) {
      if (js(i) == n) ve.push_back(i);
    }
  } else {
    for (int i = n - 1000; i < n; i++) {
      if (js(i) == n) ve.push_back(i);
    }
  }
  cout << ve.size() << endl;
  for (int i = 0; i < ve.size(); i++) {
    if (i == 0)
      printf("%d\n", ve[i]);
    else
      printf(" %d\n", ve[i]);
  }
  cout << endl;
  return 0;
}
