#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const int INF = 1e9;
long long MOD = 998244353;
long long sum(long long n) {
  long long sm = 0;
  while (n) {
    sm += n % 10;
    n /= 10;
  }
  return sm;
}
int main() {
  list<int> a;
  list<int> b;
  long long n;
  cin >> n;
  int ans = 0;
  vector<long long> res;
  for (long long i = max(n - 100, 0LL); i <= n; i++) {
    if (sum(i) + i == n) {
      ans++;
      res.push_back(i);
    }
  }
  cout << ans << "\n";
  for (int i = 0; i < res.size(); i++) {
    cout << res[i] << " ";
  }
  return 0;
}
