#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> res;
  for (int i = 0; i < min(n, 90); ++i) {
    int x = n - i;
    int sum = 0;
    int w = x;
    while (w) {
      sum += w % 10;
      w /= 10;
    }
    if (sum + x == n) {
      res.push_back(x);
    }
  }
  cout << res.size() << '\n';
  reverse(res.begin(), res.end());
  for (int x : res) cout << x << " ";
  cout << '\n';
}
