#include <bits/stdc++.h>
using namespace std;
long long INF = 1E9;
long long M = 1E9 + 7;
inline long long power(long long a, long long p) {
  long long res = 1, x = a;
  while (p) {
    if (p & 1) res = (res * x);
    x = (x * x);
    p >>= 1;
  }
  return res;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  long long n;
  cin >> n;
  vector<long long> v;
  for (int i = 0; i < 100; i++) {
    long long sum = 0;
    long long num = n - i;
    while (1) {
      sum += num % 10;
      num /= 10;
      if (num == 0) break;
    }
    if (sum == i) v.push_back(n - i);
  }
  sort(v.begin(), v.end());
  cout << (int)v.size() << "\n";
  for (long long x : v) cout << x << " ";
  return 0;
}
