#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:336777216")
using namespace std;
const int MAXN = 100000 + 10;
long long DSum(long long x) {
  long long ret = 0;
  while (x) {
    ret += x % 10;
    x /= 10;
  }
  return ret;
}
int N;
void Work() {
  scanf("%d", &N);
  vector<int> Ans;
  for (int i = N - 10000; i <= N; i++) {
    if (i < 0) continue;
    if (i + DSum(i) == N) Ans.push_back(i);
  }
  printf("%d\n", (int)Ans.size());
  for (auto i : Ans) printf("%d\n", i);
}
int main() {
  Work();
  return 0;
}
