#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9 + 10;
const int mod = (int)1e9 + 7;
const int N = (int)1e6 + 10;
const long long LLINF = (long long)3e18 + 10;
const long double pi = acos(-1.0);
const long double eps = (long double)1e-9;
template <typename T1, typename T2>
bool umin(T1 &x, T2 y) {
  if (x > y) return x = y, true;
  return false;
}
template <typename T1, typename T2>
bool umax(T1 &x, T2 y) {
  if (x < y) return x = y, true;
  return false;
}
template <typename T>
T getint() {
  char c = getchar();
  T p = 1, x = 0;
  while (c == ' ' || c == '\n') c = getchar();
  if (c == '-') p = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * p;
}
bool check(int x, int n) {
  int y = x;
  while (y > 0) {
    x += y % 10;
    y /= 10;
  }
  return x == n;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> ans;
  for (int x = n; x >= max(1, n - 10000); --x) {
    if (check(x, n)) ans.push_back(x);
  }
  cout << ans.size() << '\n';
  sort((ans).begin(), (ans).end());
  for (int i = 0; i < ans.size(); ++i) cout << ans[i] << '\n';
  return 0;
}
