#include <bits/stdc++.h>
using namespace std;
long long get_sum(long long x) {
  if (x == 0) return x;
  return get_sum(x / 10) + x % 10;
}
void solve(long long tc) {
  long long n;
  cin >> n;
  vector<long long> ans;
  for (long long i = 1; i <= 200; i++) {
    if (n - i <= 0) continue;
    long long candidate = n - i;
    if (candidate + get_sum(candidate) == n) ans.push_back(candidate);
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  long long tc = 0;
  while (t--) {
    tc++;
    solve(tc);
  }
  return 0;
}
