#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> arr;
bool checkSum(int s, int x) {
  int sum = 0;
  while (x > 0) {
    sum += (x % 10);
    x /= 10;
  }
  if (sum == s)
    return true;
  else
    return false;
}
int main() {
  cin >> n;
  for (int s = 1; s < min(100, n); s++) {
    if (checkSum(s, n - s)) arr.push_back(n - s);
  }
  sort(arr.begin(), arr.end());
  cout << arr.size() << endl;
  for (int i : arr) cout << i << " ";
  cout << endl;
}
