#include <bits/stdc++.h>
using namespace std;
int ar[123456], sz = 0;
int main() {
  int n, s = 0, a, b, c;
  cin >> n;
  for (int i = n; i >= n - 100000; i--) {
    int x = i, s = i;
    while (x) {
      s += x % 10;
      x /= 10;
    }
    if (n == s) ar[sz++] = i;
  }
  sort(ar, ar + sz);
  cout << sz << "\n";
  for (int i = 0; i < sz; i++) {
    cout << ar[i] << " ";
  }
  return 0;
}
