#include <bits/stdc++.h>
using namespace std;
long long n, k, m, a[100100];
map<long long, vector<long long> > v;
vector<long long> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, res, x, x1;
  vector<int> v;
  cin >> n;
  for (int i = 1; i <= 100; i++) {
    x = n - i;
    x1 = x;
    res = 0;
    while (x) {
      res += (x % 10);
      x /= 10;
    }
    if (res == i) v.push_back(x1);
  }
  sort(v.begin(), v.end());
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
}
