#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> ans;
  scanf("%d", &n);
  for (int i = max(0, n - 100); i < n; i++) {
    int sum = i, tmp = i;
    while (tmp > 0) sum += tmp % 10, tmp /= 10;
    if (sum == n) ans.push_back(i);
  }
  int sz = ans.size();
  printf("%d\n", sz);
  for (int i = 0; i < sz; i++) printf("%d ", ans[i]);
  return 0;
}
