#include <bits/stdc++.h>
using namespace std;
int CountNum(int n) {
  int i = 0;
  while (n > 0) {
    i++;
    n /= 10;
  }
  return i;
}
int GetSum(int a) {
  int ans = 0;
  while (a > 0) {
    ans += a % 10;
    a /= 10;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<int> ans;
  int rhs = CountNum(n) * 9;
  while (rhs > 0) {
    int f = GetSum(n - rhs);
    if (f == rhs) ans.push_back(n - rhs);
    rhs--;
  }
  cout << ans.size() << endl;
  for (auto i : ans) cout << i << " ";
  return 0;
}
