#include <bits/stdc++.h>
using namespace std;
int v[100000];
inline int sum(int n) {
  int s = 0;
  while (n > 0) {
    s += n % 10;
    n /= 10;
  }
  return s;
}
int main() {
  int n;
  cin >> n;
  for (int i = n; i > 0 && i > n - 100; i--)
    if (i + sum(i) == n) v[++v[0]] = i;
  sort(v + 1, v + v[0] + 1);
  for (int i = 0; i <= v[0]; i++) cout << v[i] << '\n';
  return 0;
}
