#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> v;
int n;
bool solve(int xx) {
  int x = xx;
  int ans = 0;
  while (x > 0) {
    ans += x % 10;
    x /= 10;
  }
  return (ans + xx == n);
}
int main() {
  scanf("%d", &n);
  for (int i = n - 90; i <= n; ++i)
    if (solve(i) && i > 0) v.push_back(i);
  printf("%d\n", (int)v.size());
  for (int i = 0; i < (int)v.size(); ++i) printf("%d ", v[i]);
  return 0;
}
