#include <bits/stdc++.h>
using namespace std;
bool check(int pt, int dig_n) {
  int tmp = 0;
  while (dig_n |= 0) {
    tmp += (dig_n % 10);
    dig_n /= 10;
  }
  if (tmp == pt) return true;
  return false;
}
int main() {
  vector<int> ans;
  int n, cnt = 0, kk;
  int dig_n = 0, temp;
  cin >> n;
  dig_n = n - 90;
  if (dig_n < 0) dig_n = 0;
  for (int i = dig_n; i < n; i++) {
    int pt = n - i;
    if (check(pt, i)) {
      ans.push_back(i);
      cnt++;
    }
  }
  cout << cnt << endl;
  for (int i = 0; i < cnt; i++) {
    cout << ans[i] << endl;
  }
}
