#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9, M = 1e3 + 3, MOD = 1e9 + 7, OO = 2e9;
const long long INF = 1e15;
vector<int> vec;
int n, mxLen;
int ten[10];
string pre;
void solve(int idx, int num, string str) {
  if (num > n) return;
  if (num == n) {
    reverse(str.begin(), str.end());
    vec.push_back(stoi(str));
    return;
  }
  if (idx == mxLen) return;
  if (idx > 2 && mxLen > 5) {
    for (int i = -1; i < 2; ++i) {
      int k = pre[idx] - '0';
      k += i;
      if (k < 0) k = 10 + k;
      if (k > 9) k = 0 + 10 - k;
      str.push_back(k + '0');
      solve(idx + 1, num + k + ten[idx] * k, str);
      str.pop_back();
    }
  } else {
    for (int i = 0; i <= 9; ++i) {
      str.push_back(i + '0');
      solve(idx + 1, num + i + ten[idx] * i, str);
      str.pop_back();
    }
  }
}
void runtestcase() {
  ten[0] = 1;
  for (int i = 1; i < 10; ++i) {
    ten[i] = ten[i - 1] * 10;
  }
  cin >> n;
  mxLen = to_string(n).size();
  pre = to_string(n);
  reverse(pre.begin(), pre.end());
  solve(0, 0, "");
  sort(vec.begin(), vec.end());
  cout << ((int)vec.size()) << '\n';
  for (auto it : vec) cout << it << ' ';
}
int main() {
  cout << fixed << setprecision(6), ios::sync_with_stdio(false),
      cin.tie(nullptr), cout.tie(nullptr);
  int t = 1, tt = 1;
  while (t--) {
    runtestcase();
    ++tt;
  }
}
