#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> ans;
  int i = n - 100;
  if (i <= 0) i = 1;
  for (; i <= n; i++) {
    int x = i, soma = x;
    while (x) {
      soma += x % 10;
      x /= 10;
    }
    if (soma == n) ans.push_back(i);
  }
  cout << ans.size() << "\n";
  for (auto x : ans) cout << x << "\n";
}
