#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
map<string, long long int> month;
void Month() {
  month["January"] = 1, month["February"] = 2, month["March"] = 3,
  month["April"] = 4, month["May"] = 5, month["June"] = 6;
  month["July"] = 7, month["August"] = 8, month["September"] = 9,
  month["October"] = 10, month["November"] = 11, month["December"] = 12;
}
long long int A[1000000];
long long int B[1000000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<long long int> v;
  long long int n, res, x = 0;
  cin >> n;
  res = n;
  while (res != 0) x++, res /= 10;
  x *= 9;
  if (x >= n)
    x = 1;
  else
    x = n - x;
  for (long long int i = x; i <= n; i++) {
    long long int val = i, s = 0;
    while (val != 0) s += (val % 10), val /= 10;
    if ((i + s) == n) v.push_back(i);
  }
  if (v.size()) {
    cout << v.size() << endl;
    for (long long int i = 0; i < v.size(); i++) cout << v[i] << endl;
  } else
    cout << 0 << endl;
  return 0;
}
