#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, sum = 0, count = 0, i, k = 1, x;
  cin >> n;
  long long int a[100];
  vector<long long int> v;
  for (i = 81; i >= 0; i--) {
    x = n - i;
    sum = 0;
    while (x != 0) {
      sum = sum + x % 10;
      x = x / 10;
    }
    if (sum == i) {
      count++;
      v.push_back(n - i);
    }
    sum = 0;
  }
  cout << count << endl;
  for (i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
}
