#include <bits/stdc++.h>
using namespace std;
bool sortin(const pair<long long int, long long int> &e,
            const pair<long long int, long long int> &f) {
  return (e.first < f.first);
}
long long int i, j, k, l, m, n, c, p, q, ts, mn = 10e17;
long long int a[200002], b[200002], x[200002];
long long int sod(long long int d) {
  c += d % 10;
  if (d == 0)
    return c;
  else
    return sod(d / 10);
}
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  };
  cin >> n;
  for (long long int i = max(p, n - 100); i <= n; i++) {
    c = 0;
    if (sod(i) + i == n) {
      a[k++] = i;
    }
  }
  cout << k;
  cout << endl;
  for (long long int i = 0; i <= k - 1; i++) cout << a[i], cout << ' ';
}
