#include <bits/stdc++.h>
using namespace std;
const long long M = 2 * (1e5) + 7, mod = 1e9 + 7;
long long ok(long long m) {
  long long cnt = 0;
  while (m > 0) {
    cnt += m % 10;
    m /= 10;
  }
  return cnt;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  {
    long long n;
    cin >> n;
    long long m = n;
    vector<long long> v;
    for (long long i = 0; i <= 9 * 9 && m >= 0; i++) {
      if (ok(m) == i) v.push_back(m);
      --m;
    }
    sort(v.begin(), v.end());
    cout << v.size() << "\n";
    for (auto u : v) cout << u << " ";
    cout << "\n";
  }
  return 0;
}
