#include <bits/stdc++.h>
using namespace std;
bool check(int a, int n) {
  int b = a;
  int t = 0;
  while (b) {
    t += b % 10;
    b /= 10;
  }
  return a + t == n;
}
int main() {
  char str[20];
  scanf("%s", str);
  int n = atoi(str);
  int dig = strlen(str);
  int l = max(1, n - dig * 9);
  vector<int> ans;
  for (int i = l; i <= n; ++i) {
    if (check(i, n)) {
      ans.push_back(i);
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  return 0;
}
