#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)(2e5) + 2;
const int MOD = (int)(1e9) + 7;
int get(int x) {
  int res = 0;
  while (x) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> ans;
  for (int i = max(1, n - 100); i <= n; i++) {
    int x = i;
    if (i + get(i) == n) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
  return 0;
}
