#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> ans;
int main() {
  scanf("%d", &n);
  for (int x = n; x >= n - 81; x--) {
    int sum = 0;
    int t = x;
    while (t) {
      sum += t % 10;
      t /= 10;
    }
    if (sum + x == n) ans.push_back(x);
  }
  sort(ans.begin(), ans.end());
  printf("%d\n", ans.size());
  for (int x : ans) printf("%d\n", x);
  return 0;
}
