#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<int> v;
int numOfDigits(int n) {
  int ret = 0;
  while (n > 0) {
    n = n / 10;
    ret++;
  }
  return ret;
}
int sumOfDigits(int n) {
  int ret = 0;
  while (n > 0) {
    int a = n % 10;
    n = n / 10;
    ret += a;
  }
  return ret;
}
void calc(int a, int b) {
  for (int i = a; i <= b; i++) {
    if (i + sumOfDigits(i) == b) v.push_back(i);
  }
}
int main() {
  int n, t, hold = 0, a, b, i, j;
  cin >> n;
  calc(max(n - 5000, 0), n);
  cout << v.size() << endl;
  for (i = 0; i < v.size(); i++) cout << v[i] << " ";
  printf("\n");
  return 0;
}
