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