#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, cur, cnt;
  cin >> n;
  long long x = max(1LL * 0, n - 300);
  vector<int> ans;
  for (long long i = x; i <= n; ++i) {
    cur = i;
    cnt = 0;
    while (cur) {
      cnt += cur % 10;
      cur /= 10;
    }
    if (cnt + i == n) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << endl;
  }
}
