#include <bits/stdc++.h>
using namespace std;
const long long INF = (1ll << 62) - 1;
const int inf = (1 << 30) - 1;
vector<int> ans;
int sm(int x) {
  int s = 0;
  while (x) {
    s += x % 10;
    x /= 10;
  }
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i <= 90; i++) {
    int x = n - i;
    if (x < 0) break;
    if (sm(x) + x == n) ans.push_back(x);
  }
  cout << ans.size() << endl;
  sort(ans.begin(), ans.end());
  if (ans.size()) {
    for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  }
}
