#include <bits/stdc++.h>
using namespace std;
int sum(int x) {
  int res = 0;
  while (x) {
    res += (x % 10);
    x /= 10;
  }
  return res;
}
int main() {
  long long n, a, i, c = 1000;
  vector<long long> v;
  cin >> n;
  a = min(c, n);
  for (i = 1; i <= a; i++) {
    long long x = n - i;
    if ((x + sum(x)) == n) v.push_back(x);
  }
  cout << v.size() << endl;
  sort(v.begin(), v.end());
  for (i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
}
