#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e9;
vector<int> ans;
int n, k;
int cal(int n) {
  int ans = n;
  while (n) {
    ans += n % 10;
    n /= 10;
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  int cnt = 0;
  for (int i = n; i >= 1; i--) {
    cnt++;
    if (cnt > 1000) break;
    int num = cal(i);
    if (num == n) ans.push_back(i);
  }
  sort(ans.begin(), ans.end());
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i]);
  }
}
