#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  stringstream convert;
  convert << n;
  string s = convert.str();
  int x = n - 9 * s.length();
  vector<int> v;
  string s2;
  int y;
  for (; x <= n; x++) {
    convert.str(string());
    convert << x;
    s2 = convert.str();
    y = x;
    for (int i = 0; i < s2.length(); i++) y += s2[i] - 48;
    if (y == n) v.push_back(x);
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
}
