#include <bits/stdc++.h>
using namespace std;
const int INFTY = 20000000;
const int MAX = 500100;
const int MOD = 10000000;
void coutTab(int* tab, int n) {
  for (int i = 0; i < n; i++) {
    cout << tab[i] << " ";
  }
  cout << "\n";
}
int sumN(int n) {
  if (n < 10)
    return n;
  else
    return sumN(n / 10) + n % 10;
}
vector<int> ok;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = max(n - 81, 0); i < n; i++) {
    if (i + sumN(i) == n) {
      ok.push_back(i);
    }
  }
  cout << (ok).size() << "\n";
  for (int i = 0; i < (ok).size(); i++) cout << ok[i] << " ";
}
