#include <bits/stdc++.h>
using namespace std;
void chuyenVi(int a[2][3], int n, int m) {
  cout << endl << "chuyen vi" << endl;
  int A[m][n];
  int N = n * m;
  int t = 0;
  for (int i = 0; i < m; ++i)
    for (int j = 0; j < n; ++j) {
      A[j][i] = a[i][j];
      t++;
    }
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < n; ++j) cout << A[i][j] << "  ";
    cout << endl;
  }
}
int main() {
  long long int n;
  cin >> n;
  vector<long long int> a;
  for (int i = n; i >= 0; --i) {
    int x = log(i) + 1;
    int num = x * 9;
    long long int tmp = i;
    long long int res = i;
    if (num + i >= n) {
      while (res > 0) {
        tmp += (res % 10);
        res /= 10;
      }
      if (tmp == n) a.push_back(i);
    } else
      break;
  }
  if (a.size() > 0) {
    cout << a.size() << endl;
    for (int i = a.size() - 1; i >= 0; --i) cout << a[i] << " ";
  } else
    cout << 0;
  return 0;
}
