#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  vector<int> V;
  cin >> n;
  for (size_t i = (1); i < (82); i++) {
    int p = n - i, temp = 0;
    if (p <= 0) break;
    while (p > 0) temp += p % 10, p /= 10;
    if (temp == i) V.push_back(n - i);
  }
  sort((V).begin(), (V).end());
  cout << V.size() << endl;
  for (size_t i = (0); i < (V.size()); i++) cout << V[i] << endl;
}
