#include <bits/stdc++.h>
using namespace std;
const int K = 100;
int n;
vector<int> p;
int sum(int x) {
  int cnt = 0;
  if (x <= 0) return 0;
  while (x) {
    cnt += x % 10;
    x /= 10;
  }
  return cnt;
}
int main() {
  cin >> n;
  for (int i = 1; i <= K; i++) {
    if (sum(n - i) == i) p.push_back(n - i);
  }
  sort(p.begin(), p.end());
  cout << (int)p.size() << endl;
  for (auto i : p) {
    cout << i << " ";
  }
  return 0;
}
