#include <bits/stdc++.h>
using namespace std;
int a[15];
int sum = 0;
int get(int x) {
  int i = 0;
  while (x) {
    a[++i] = x % 10;
    sum += a[i];
    x /= 10;
  }
  return i;
}
int main() {
  vector<int> vec;
  int ans = 0;
  int num;
  cin >> num;
  for (int i = ((num - 81) > 0 ? num - 81 : 0); i < num; ++i) {
    int res = 0;
    int shit = get(i);
    for (int j = 1; j <= shit; ++j) {
      res += a[j];
    }
    if (res + i == num) {
      ans++;
      vec.push_back(i);
    }
  }
  cout << ans << endl;
  for (int i = 0; i < vec.size(); ++i) {
    cout << vec[i] << endl;
  }
}
