#include <bits/stdc++.h>
using namespace std;
bool f(int k, int n) {
  int s = k;
  while (k > 0) {
    s += k % 10;
    k /= 10;
  }
  return s == n;
}
int main() {
  int i, n;
  vector<int> ans;
  cin >> n;
  for (i = n - 100; i <= n + 100; ++i) {
    if (f(i, n)) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " ";
  }
  return 0;
}
