#include <bits/stdc++.h>
using namespace std;
int sum(int k) {
  int sums = 0;
  while (k > 0) {
    sums += k % 10;
    k /= 10;
  }
  return sums;
}
int main() {
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = 1; i < 100; i++) {
    if (n - i <= 0) continue;
    int candidate = n - i;
    if (candidate + sum(candidate) == n) {
      ans.push_back(candidate);
    }
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
