#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int sum(int n) {
  int s(0);
  while (n > 0) {
    s += (n % 10);
    n /= 10;
  }
  return s;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = min(81, n); i > 0; i--) {
    if (sum(n - i) == i) ans.push_back(n - i);
  }
  cout << (int)ans.size() << endl;
  for (int i = 0; i < (int)ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
