#include <bits/stdc++.h>
using namespace std;
int init() {
  char c = getchar();
  int jg = 0, zf = 1;
  while (c < '0' || c > '9') {
    if (c == '-') zf *= -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    jg = (jg << 1) + (jg << 3) + c - '0';
    c = getchar();
  }
  return jg * zf;
}
int n, zs, dan[1001];
int main() {
  n = init();
  for (int i = max(1, n - 100); i <= n; i++) {
    int yy = i, ans = 0;
    while (yy) {
      ans += yy % 10;
      yy /= 10;
    }
    ans += i;
    if (ans == n) dan[++dan[0]] = i;
  }
  cout << dan[0] << endl;
  for (int i = 1; i <= dan[0]; i++) cout << dan[i] << endl;
  return 0;
}
