#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b, c, cnt, ans, x, z;
vector<int> v, f;
set<int> st;
map<int, int> mp;
int used[6000];
int main() {
  cin >> n;
  m = n;
  if (n < 100) {
    for (int i = 1; i <= n; i++) {
      a = i;
      while (a) {
        cnt += a % 10;
        a /= 10;
      }
      if (i + cnt == n) {
        v.push_back(i);
      }
      cnt = 0;
    }
  }
  if (!v.empty()) {
    cout << v.size() << endl;
    for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
    return 0;
  }
  for (int i = n - 100; i <= n; i++) {
    a = i;
    while (a) {
      cnt += a % 10;
      a /= 10;
    }
    if (i + cnt == n) {
      v.push_back(i);
    }
    cnt = 0;
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
