#include <bits/stdc++.h>
using namespace std;
int n;
int get(int x) {
  int ret = 0;
  while (x > 0) {
    ret += x % 10;
    x /= 10;
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  vector<int> ans;
  for (int x = (max(1, n - 100)); x < (n + 1); ++x) {
    if (x + get(x) == n) ans.push_back(x);
  }
  printf("%d\n", ((int)(ans).size()));
  for (int i = (0); i < (((int)(ans).size())); ++i) cout << ans[i] << endl;
  return 0;
}
