#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> ve;
int digsum(int n) {
  int sum = 0;
  while (n != 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  cin >> n;
  for (int i = 0; i < 81; i++) {
    int s = n - i;
    if (digsum(s) == i) {
      ve.push_back(s);
    }
  }
  sort(ve.begin(), ve.end());
  cout << ve.size() << endl;
  for (int i = 0; i < ve.size(); i++) cout << ve[i] << endl;
  return 0;
}
