#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int n;
  cin >> n;
  int temp = n;
  int count = 0, digit, num, sum;
  while (temp > 0) {
    count++;
    temp = temp / 10;
  }
  count = count * 9;
  for (int i = 1; i <= count; i++) {
    num = n - i;
    sum = 0;
    while (num > 0) {
      digit = num % 10;
      sum = sum + digit;
      num /= 10;
    }
    if (sum == i) {
      v.push_back(n - i);
    }
  }
  sort(v.begin(), v.end());
  if (v.size() == 0) {
    cout << "0" << endl;
  } else {
    cout << v.size() << endl;
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
  }
}
