#include <bits/stdc++.h>
using namespace std;
inline long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
bool _cmp(const pair<int, int>& i, const pair<int, int>& j) {
  return ((i.first == j.first) ? (i.second > j.second) : (i.first < j.first));
}
struct Node {
  int x, y;
  Node(int a = 0, int b = 0) : x(a), y(b) {}
  bool operator<(const Node& a) const {
    return ((x == a.x) ? (y > a.y) : (x < a.x));
  }
};
long long ncase = 1;
long long N, M, a, b, c;
string str;
void pre() { return; }
void sol();
void init() { N = getint(); }
vector<int> ans;
bool ok(int x) {
  int xx = N - x, sum = 0;
  while (xx) {
    sum += xx % 10;
    xx /= 10;
  }
  return sum == x;
}
void sol() {
  for (int i = 0; i <= 1000; ++i) {
    if (N - i <= 0) break;
    if (ok(i)) ans.push_back(N - i);
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (int i : ans) cout << i << " ";
  cout << endl;
  return;
}
int main() {
  pre();
  while (ncase--) {
    init();
    sol();
  }
}
