#include <bits/stdc++.h>
using namespace std;
int cnt(int x) {
  int tmp = x;
  while (tmp > 0) {
    x += (tmp % 10);
    tmp /= 10;
  }
  return x;
}
int main() {
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = n - 100; i <= n; ++i) {
    if (cnt(i) == n) ans.push_back(i);
  }
  cout << ans.size() << endl;
  for (int i : ans) {
    cout << i;
    if (i != ans.back())
      cout << ' ';
    else
      cout << endl;
  }
  return 0;
}
