#include <bits/stdc++.h>
using namespace std;
int getsum(int x) {
  int sum = 0;
  while (x) {
    sum += (x % 10);
    x /= 10;
  }
  return sum;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> res;
  for (int sum = (1); sum <= (min(99, n - 1)); ++sum) {
    int x = n - sum;
    if (getsum(x) == sum) res.push_back(x);
  }
  sort(res.begin(), res.end());
  cout << res.size() << "\n";
  for (int i = (0); i <= ((int)res.size() - 1); ++i) cout << res[i] << "\n";
  return 0;
}
