#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 5;
using LL = long long;
int main() {
  LL n;
  cin >> n;
  LL st = n - 1000;
  st = max(0LL, st);
  vector<int> ans;
  for (int i = st; i <= n; i++) {
    string s = to_string(i);
    int sum = i;
    for (auto v : s) sum += v - 48;
    if (sum == n) ans.push_back(i);
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) {
    printf("%d", ans[i]);
    if (i == ans.size() - 1)
      printf("\n");
    else
      printf(" ");
  }
  return 0;
}
