#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
long long bin(vector<pair<long long, long long> > a, long long l, long long r,
              long long x) {
  while (l < r) {
    long long mid = l + (r - l) / 2;
    if (x < a[mid].second) {
      r = mid - 1;
    } else if (x > a[mid].second)
      l = mid + 1;
    else if (x == a[mid].second)
      return mid;
  }
  return l;
}
long long exp(long long x, long long y, long long m) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return (exp(((x % m) * (x % m)) % m, y / 2, m)) % m;
  else
    return ((x % m) * exp(((x % m) * (x % m)) % m, (y - 1) / 2, m)) % m;
}
long long d, x, y;
void extendedEuclid(long long A, long long B) {
  if (B == 0) {
    d = A;
    x = 1;
    y = 0;
  } else {
    extendedEuclid(B, A % B);
    long long temp = x;
    x = y;
    y = temp - (A / B) * y;
  }
}
set<long long> se;
vector<bool> seive(int a) {
  int c = 0;
  vector<bool> v(a + 1);
  for (long long i = 0; i < a + 1; i++) v[i] = false;
  v[0] = v[1] = true;
  for (int i = 2; i * i <= a; i++) {
    if (v[i] == false)
      for (int j = i * i; j <= a; j += i) v[j] = true;
  }
  return v;
  for (long long i = 0; i < a + 1; i++)
    if (v[i] == false) se.insert(i);
}
long long modInverse(long long A, long long M) {
  extendedEuclid(A, M);
  return (x % M + M) % M;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long k, b, ma = 0, f, a, c = 0, sum = 0, q, t = -1;
  int n;
  long long m = 1000000007;
  cin >> n;
  vector<int> v;
  int x = max(n - 81, 0);
  while (x < n) {
    c = x;
    sum = x;
    while (c != 0) {
      q = c % 10;
      sum += q;
      c /= 10;
    }
    if (sum == n) {
      v.push_back(x);
    }
    x++;
  }
  n = v.size();
  cout << n << '\n';
  for (long long i = 0; i < n; i++) {
    cout << v[i] << '\n';
  }
}
