#include <bits/stdc++.h>
using namespace std;
int n;
int a[100000];
int calc(int x) {
  int res = x;
  while (x) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
int main() {
  int s = 0;
  scanf("%d", &n);
  for (int i = max(1, n - 88); i <= n; i++) {
    if (calc(i) == n) {
      a[++s] = i;
    }
  }
  printf("%d\n", s);
  for (int i = 1; i <= s; i++) {
    printf("%d ", a[i]);
  }
  return 0;
}
