#include <bits/stdc++.h>
using namespace std;
set<int> ans;
int main() {
  int n;
  scanf("%d", &n);
  int l = max(0, n - 1000);
  for (int i = l; i <= n; i++) {
    int ret = i;
    int tmp = ret;
    while (tmp) {
      ret += tmp % 10;
      tmp /= 10;
    }
    if (ret == n) ans.insert(i);
  }
  printf("%d\n", ans.size());
  for (auto it = ans.begin(); it != ans.end(); it++) printf("%d\n", *it);
  return 0;
}
