#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int main() {
  vector<int> v;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 82; i++) {
    int x = n - i;
    int sum = 0;
    while (x > 0) {
      sum += (x % 10);
      x /= 10;
    }
    if (sum == i) {
      v.push_back(n - i);
    }
  }
  if (v.size() == 0) {
    printf("%d\n", 0);
    return 0;
  }
  printf("%d\n", (int)v.size());
  sort(v.begin(), v.end());
  for (auto i : v) {
    printf("%d\n", i);
  }
}
