#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#pragma GCC optimize("Ofast")
using namespace std;
void fastio() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long dp[101][1001], ans1 = 1e10, dp1[1000001];
long long num[10];
long long sum(long long n) {
  long long sum = 0, m;
  while (n) {
    m = n % 10;
    sum += m;
    n /= 10;
  }
  return sum;
}
long long len(long long n) {
  long long c = 0;
  while (n) {
    c++;
    n /= 10;
  }
  return c;
}
signed main() {
  fastio();
  long long t = 1;
  while (t--) {
    long long n, c = 0, d = 0, s = 0;
    cin >> n;
    long long b[n], j = 0;
    long long x = len(n), xx = 0;
    for (long long i = n - x * 9; i <= n; i++) {
      if (i + sum(i) == n) {
        xx++;
      }
    }
    if (xx) {
      cout << xx << "\n";
      for (long long i = n - x * 9; i <= n; i++) {
        if (i + sum(i) == n) {
          cout << i << "\n";
        }
      }
    }
    if (xx == 0) cout << 0;
  }
}
