#include <bits/stdc++.h>
using namespace std;
int n;
bool f(int k) {
  int ans = k;
  while (k) ans += (k % 10), k /= 10;
  return ans == n;
}
int main() {
  int i;
  vector<int> v;
  scanf("%d", &n);
  for (i = max(1, n - 100); i <= n; i++)
    if (f(i)) v.push_back(i);
  printf("%d\n", v.size());
  for (i = 0; i < v.size(); i++)
    printf("%d%c", v[i], i == v.size() - 1 ? '\n' : ' ');
}
