#include <bits/stdc++.h>
using namespace std;
long long ans(int a) {
  long long sum = 0;
  while (a != 0) {
    sum += a % 10;
    a /= 10;
  }
  return sum;
}
const int N = 1e5 + 10;
int main() {
  long long n, a[N], j = 0;
  cin >> n;
  for (long long i = n; i >= n - 100 && i > 0; i--) {
    if (i + ans(i) == n) {
      a[j++] = i;
    }
  }
  cout << j << endl;
  sort(a, a + j);
  if (j == 0) return 0;
  for (int i = 0; i < j; i++) cout << a[i] << endl;
  return 0;
}
