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