#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.second < b.second; }
void solve() {
  long long n;
  cin >> n;
  vector<long long> op;
  for (int i = 0; i <= 999; i++) {
    if (n - i < 0) {
      break;
    }
    long long p = n - i;
    long long x = 0;
    while (p > 0) {
      x += (p % 10);
      p /= 10;
    }
    if (x == i) {
      op.push_back(n - i);
    }
  }
  cout << op.size() << "\n";
  sort(op.begin(), op.end());
  for (int to : op) {
    cout << to << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
