#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 3e5 + 5;
const int M = 1e6;
const long long INF = (long long)(1e18);
const int inf = 1e9;
const long long MOD = 998244353LL;
void solve() {}
int sumOfDig(int x) {
  int res = 0;
  while (x > 0) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> res;
  for (int i = 1; i <= 81; i++) {
    if (n - i <= 0) break;
    if (sumOfDig(n - i) == i) res.push_back(n - i);
  }
  reverse(res.begin(), res.end());
  cout << res.size() << "\n";
  for (auto it : res) cout << it << " ";
  return 0;
}
