#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int mx = 1e8;
using namespace std;
int solve() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 1; i <= 81; i++) {
    int temp = n - i, sum = 0;
    while (temp > 0) {
      sum += temp % 10;
      temp /= 10;
    }
    if (sum == i) s.insert(n - i);
  }
  cout << s.size() << endl;
  for (auto it : s) cout << it << " ";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int q;
  solve();
}
