#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> final;
  int maxdigitsum = 0;
  int x = n;
  if (n <= 10) {
    if (n % 2 == 0)
      cout << 1 << endl << n / 2;
    else
      cout << 0 << endl;
    return 0;
  }
  for (int i = max(1, n - 100); i <= n; i++) {
    int temp = i;
    int sum = 0;
    while (temp > 0) {
      sum += temp % 10;
      temp /= 10;
    }
    if (sum + i == n) final.push_back(i);
  }
  cout << final.size() << endl;
  for (int i : final) cout << i << endl;
}
