#include <bits/stdc++.h>
using namespace std;
int f(int n) {
  int res = n;
  while (n) {
    res += n % 10;
    n /= 10;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int sum = 0;
  vector<int> res;
  for (int i = n; i >= 1; i--) {
    if (n - i > (log10(i) + 1) * 9) break;
    if (f(i) == n) res.push_back(i);
  }
  cout << res.size() << endl;
  for (int i = (int)res.size() - 1; i >= 0; i--) cout << res[i] << " ";
}
