#include <bits/stdc++.h>
using namespace std;
bool arithmetic(int x, int val) {
  int digit_sum = 0;
  while (x > 0) {
    digit_sum += x % 10;
    x /= 10;
  }
  return digit_sum == val;
}
int main() {
  int n, digits = 0;
  cin >> n;
  vector<int> ans;
  if (n == 0) {
    digits = 1;
  } else {
    int k = n;
    while (k > 0) {
      digits++;
      k /= 10;
    }
  }
  for (int i = 0; i <= min(n, digits * 9); i++) {
    if (arithmetic(n - i, i)) {
      ans.push_back(n - i);
    }
  }
  cout << ans.size() << endl;
  for (int i = ans.size() - 1; i >= 0; i--) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
