#include <bits/stdc++.h>
const double Pi = acos(-1.0);
using namespace std;
int n;
int sum(int x) {
  int res = 0;
  while (x) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
int main(int argc, char** argv) {
  scanf("%d", &n);
  vector<int> ans;
  for (int i = max(n - 81, 0); i <= n; i++) {
    if (i + sum(i) == n) ans.push_back(i);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < (int)ans.size(); i++) printf("%d\n", ans[i]);
  return 0;
}
