#include <bits/stdc++.h>
using namespace std;
int digit(int n) {
  int k = 0;
  while (n) {
    k++;
    n /= 10;
  }
  return k;
}
int main() {
  int n, i;
  int a[105];
  while (cin >> n) {
    int cnt = 0;
    int s = n - digit(n) * 9;
    for (i = s; i <= n; i++) {
      int sum = i;
      int num = i;
      while (num) {
        sum += num % 10;
        num /= 10;
      }
      if (sum == n) a[cnt++] = i;
    }
    if (cnt == 0)
      cout << 0 << endl;
    else {
      cout << cnt << endl;
      sort(a, a + cnt);
      for (i = 0; i < cnt; i++) cout << a[i] << " ";
    }
  }
  return 0;
}
