#include <bits/stdc++.h>
using namespace std;
const int maxi = 1e6 + 6;
int n;
int a[maxi];
string s;
vector<int> ans;
void check(int x) {
  int m = x;
  int sum = 0;
  while (m > 0) {
    sum += m % 10;
    m /= 10;
  }
  if (x + sum == n) {
    ans.push_back(x);
  }
}
int main() {
  cin >> n;
  for (int i = max(n - 1000, 1); i <= n; i++) check(i);
  printf("%d\n", ans.size());
  for (int i : ans) printf("%d\n", i);
  return 0;
}
