#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int num = 0;
  vector<int> ans;
  int k = 0;
  if (n >= 200)
    k = n - 200;
  else
    k = 1;
  for (int i = k; i <= n; i++) {
    int p = i;
    int digitsum = 0;
    while (p != 0) {
      digitsum += p % 10;
      p /= 10;
    }
    int sum = digitsum + i;
    if (sum == n) {
      num++;
      ans.push_back(i);
    }
  }
  cout << num << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
