#include <bits/stdc++.h>
using namespace std;
int Calc(int n) {
  int ans = 0;
  while (n) {
    ans += n % 10;
    n /= 10;
  }
  return ans;
}
int a[1000];
int main(void) {
  int n, ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < 1000 && i <= n; ++i) {
    if (Calc(n - i) == i) {
      a[ans++] = n - i;
    }
  }
  printf("%d\n", ans);
  for (int i = ans - 1; i >= 0; --i) {
    printf("%d ", a[i]);
  }
  putchar('\n');
  return 0;
}
