#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  for (int i = n; i >= n - 100; --i) {
    int I = i, s = 0;
    while (I) {
      s += I % 10;
      I /= 10;
    }
    if (i + s == n) a.push_back(i);
  }
  reverse(a.begin(), a.end());
  cout << a.size() << '\n';
  for (int i : a) cout << i << ' ';
}
