#include <bits/stdc++.h>
using namespace std;
long long res[10000], a[20];
inline int S(long long k) {
  int res = 0;
  while (k) res += k % 10, k /= 10;
  return res;
}
int main() {
  int cnt = 0;
  long long val = 1;
  do {
    res[cnt++] = val;
    val++;
    long long tmp = val, t = 1, c = 0;
    for (c = 0; tmp; c++, tmp /= 10, t *= 10) {
      a[c] = tmp * t + t - 1;
    }
    val = a[0];
    for (int i = 0; i < c; i++)
      if (val * S(a[i]) > a[i] * S(val)) val = a[i];
  } while (val < 1000000000000000ll);
  long long n;
  scanf("%lld", &n);
  int p = upper_bound(res, res + cnt, n) - res;
  for (int i = 0; i < p; i++) printf("%lld\n", res[i]);
  return 0;
}
