#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e9 + 3;
long long n, sum;
vector<int> vec;
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = n - 100; i <= n; i++) {
    long long x = i;
    while (x) {
      sum += x % 10;
      x /= 10;
    }
    sum += i;
    if (sum == n) vec.push_back(i);
    sum = 0;
  }
  cout << vec.size() << endl;
  for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
  cout << endl;
  return 0;
}
