#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a;
  long long c = 0;
  for (int i = 1; i <= 100; ++i) {
    long long b = n - i;
    long long su = 0;
    string s = to_string(b);
    for (int j = 0; j < s.length(); ++j) {
      su += s[j] - '0';
    }
    if (su == i) {
      a.push_back(b);
      c++;
    }
  }
  if (c) {
    cout << c << endl;
    sort(a.begin(), a.end());
    for (int i = 0; i < a.size(); ++i) cout << a[i] << endl;
  } else
    cout << 0;
}
