#include <bits/stdc++.h>
using namespace std;
int n, tot, ans[82];
bool check(int x) {
  int y = x, cnt = x;
  while (y) cnt += y % 10, y /= 10;
  return cnt == n;
}
int main() {
  scanf("%d", &n);
  for (int i = max(1, n - 81); i <= n; i++)
    if (check(i)) ans[++tot] = i;
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++) printf("%d ", ans[i]);
}
