#include <bits/stdc++.h>
using namespace std;
int n, v[100], k;
int sum(int x) {
  int sum = 0;
  while (x > 0) {
    sum += x % 10;
    x /= 10;
  }
  return sum;
}
int main() {
  cin >> n;
  for (int i = max(1, n - 81); i <= n; i++) {
    if (i + sum(i) == n) {
      v[++k] = i;
    }
  }
  cout << k << '\n';
  for (int i = 1; i <= k; i++) {
    cout << v[i] << ' ';
  }
  return 0;
}
