#include <bits/stdc++.h>
using namespace std;
long long check(long long i, long long n) {
  long long s = 0;
  long long t = i;
  while (t > 0) s += t % 10, t /= 10;
  if (s + i == n)
    return 1;
  else
    return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    long long n;
    cin >> n;
    vector<long long int> ans;
    for (int i = n; i >= n - 100; i--)
      if (check(i, n)) ans.push_back(i);
    cout << (long long int)ans.size() << '\n';
    sort((ans).begin(), (ans).end());
    for (auto i : ans) cout << i << " ";
  }
  return 0;
}
