#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int get(int x) {
  int res = 0;
  while (x) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
int main() {
  int n;
  while (cin >> n) {
    vector<int> v;
    v.clear();
    for (int i = (n > 100 ? (n - 100) : 1); i <= n; i++) {
      if (get(i) + i == n) v.push_back(i);
    }
    cout << v.size() << endl;
    if (v.size()) {
      for (auto i : v) cout << i << " ";
      cout << endl;
    }
  }
  return 0;
}
