#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chkmax(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline void chkmin(T& x, U y) {
  if (y < x) x = y;
}
const int MAXN = 2e5 + 5;
int ans[111], n, c;
int main() {
  scanf("%d", &n);
  for (int sum = 1; sum <= 100 && sum <= n; sum++) {
    int x = n - sum, tot = 0;
    while (x) tot += x % 10, x /= 10;
    if (tot == sum) ans[c++] = n - sum;
  }
  sort(ans, ans + c);
  printf("%d\n", c);
  for (int i = 0; i < c; i++) printf("%d\n", ans[i]);
  return 0;
}
