#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long dig(long long num) {
  long long sum = 0;
  for (; num > 0; num /= 10) sum += num % 10;
  return sum;
}
int main() {
  long long n, ans = 0;
  cin >> n;
  for (long long i = 100; i >= 0; i--) {
    long long num = n - i;
    if (num < 0) continue;
    if (dig(num) == i && num + dig(num) == n) ans++, v.push_back(num);
  }
  cout << ans << endl;
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
}
