#include <bits/stdc++.h>
using namespace std;
int jisuan(int x) {
  int sum = 0;
  while (x) {
    sum += x % 10;
    x /= 10;
  }
  return sum;
}
int main() {
  int n, cnt = 0, a[110] = {0};
  cin >> n;
  for (int j = n - 1000; j < n; j++) {
    if (j + jisuan(j) == n) {
      a[cnt++] = j;
    }
  }
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++) cout << a[i] << endl;
  return 0;
}
