#include <bits/stdc++.h>
using namespace std;
int n;
int f(int x) {
  int ret = 0;
  while (x) {
    ret += (x % 10);
    x /= 10;
  }
  return ret;
}
void solve() {
  scanf("%d", &n);
  vector<int> vec;
  for (int i = max(1, n - 1000); i <= n; ++i) {
    if (i + f(i) == n) {
      vec.push_back(i);
    }
  }
  printf("%d\n", vec.size());
  for (int x : vec) {
    printf("%d ", x);
  }
}
int main() {
  int tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}
