#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s = to_string(n);
  int len = s.length();
  if (len == 1) {
    if (n % 2 == 0) {
      cout << "1"
           << "\n";
      cout << n / 2;
    } else
      cout << "0";
  } else {
    int sum = 0;
    int count = 0;
    int x;
    vector<int> v;
    len = len * 9;
    if (len > n) {
      for (int i = 0; i < n; i++) {
        x = i;
        sum = x;
        while (x > 0) {
          sum += x % 10;
          x = x / 10;
        }
        if (sum == n) {
          count++;
          v.push_back(i);
        }
      }
      if (count == 0)
        cout << "0";
      else {
        cout << count << "\n";
        for (auto t : v) {
          cout << t << " ";
        }
      }
    } else {
      for (int i = n - len; i < n; i++) {
        x = i;
        sum = x;
        while (x > 0) {
          sum += x % 10;
          x = x / 10;
        }
        if (sum == n) {
          count++;
          v.push_back(i);
        }
      }
      if (count == 0)
        cout << "0";
      else {
        cout << count << "\n";
        for (auto t : v) {
          cout << t << " ";
        }
      }
    }
  }
  return 0;
}
