#include <bits/stdc++.h>
using namespace std;
long long i, j, m, nn, p, q, r, s, n, c = 0;
vector<long long> v;
long long sumOfDigits(long long x) {
  long long sum = 0;
  while (x > 0) {
    sum += x % 10;
    x /= 10;
  }
  return sum;
}
int main() {
  cin >> m;
  p = m - 1;
  for (i = 1; i <= 100000; i++) {
    q = p + sumOfDigits(p);
    if (q == m && p > 0) v.push_back(p);
    if (p < 1) break;
    p--;
  }
  if (v.size() == 0)
    cout << 0;
  else {
    sort(v.begin(), v.end());
    cout << v.size() << "\n";
    for (i = 0; i < v.size(); i++) cout << v[i] << "\n";
  }
}
