#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long i, sum, t, k = 0;
  vector<long long> v;
  long long start = 0;
  if (n > 100) start = n - 100;
  for (i = start; i < n; i++) {
    t = i;
    sum = 0;
    while (t) {
      sum += t % 10;
      t /= 10;
    }
    if (i + sum == n) {
      k++;
      v.push_back(i);
    }
  }
  cout << k << endl;
  for (i = 0; i < k; i++) {
    cout << v[i] << " ";
  }
}
