#include <bits/stdc++.h>
using namespace std;
long long res[10000];
int main() {
  int cur = 0;
  for (int i = 1; i < 10; i++) res[cur++] = i;
  for (int i = 1; i < 10; i++) res[cur++] = i * 10 + 9;
  long long val = 99, u = 100;
  for (int i = 2; i <= 15; i++) {
    for (int j = 10; j < 10 * min(i, 10); j++) res[cur++] = j * u + val;
    val = val * 10 + 9;
    u *= 10;
    for (int j = i; j < 10; j++) res[cur++] = j * u + val;
  }
  long long k;
  scanf("%lld", &k);
  int p = lower_bound(res, res + cur, k) - res;
  for (int i = 0; i <= p; i++) printf("%lld\n", res[i]);
  return 0;
}
