#include <bits/stdc++.h>
using namespace std;
int n;
inline int sum(int x) {
  int cur = 0;
  while (x) {
    cur += x % 10;
    x /= 10;
  }
  return cur;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vector<int> q;
  for (int i = 0; i <= min(n, 1000000); i++) {
    if (sum(n - i) == i && n - i > 0) {
      q.push_back(n - i);
    }
  }
  cout << q.size() << "\n";
  sort(q.begin(), q.end());
  for (auto it : q) {
    cout << it << " ";
  }
}
