#include <bits/stdc++.h>
using namespace std;
int cf[1000], ans[1001], tot, cnt, n, i, j;
int main() {
  scanf("%d", &n);
  for (i = max(1, n - 81); i <= n; i++) {
    int sum = i, tmp = i;
    cnt = 0;
    while (tmp) {
      cf[++cnt] = tmp % 10;
      tmp /= 10;
    }
    for (j = 1; j <= cnt; j++) sum += cf[j];
    if (sum == n) ans[++tot] = i;
  }
  printf("%d\n", tot);
  for (i = 1; i <= tot; i++) printf("%d\n", ans[i]);
}
