#include <bits/stdc++.h>
using namespace std;
int sum(int x) {
  int dig, ret = 0;
  while (x > 0) {
    dig = x % 10;
    x -= dig;
    x /= 10;
    ret += dig;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int ini = max(1, n - (int)1e6);
  vector<int> sol;
  for (int x = ini; x <= n; x++) {
    if (x + sum(x) == n) sol.push_back(x);
  }
  int tam = sol.size();
  cout << tam << "\n";
  for (int i = 0; i < tam; i++) {
    cout << sol[i] << " ";
  }
  if (tam > 0) cout << "\n";
  return 0;
}
