#include <bits/stdc++.h>
using namespace std;
long long k;
const int ans[] = {1,   2,   3,   4,   5,   6,   7,   8,   9,
                   19,  29,  39,  49,  59,  69,  79,  89,  99,
                   199, 299, 399, 499, 599, 699, 799, 899, 999};
int main() {
  scanf("%lld", &k);
  if (k <= 999) {
    for (register int i = 0; ans[i] <= k; ++i) printf("%d\n", ans[i]);
    return 0;
  }
  for (register int i = 0; i < 27; ++i) printf("%d\n", ans[i]);
  for (register int i = 4; i <= 9; ++i) {
    for (register int j = 10, j_lim = i * 10 - 21; j <= j_lim; ++j) {
      register long long res = j * pow(10, i - 2) + pow(10, i - 2) - 1;
      if (res > k) return 0;
      printf("%lld\n", res);
    }
    for (register int j = i - 2, j_lim = 9; j <= j_lim; ++j) {
      register long long res = j * pow(10, i - 1) + pow(10, i - 1) - 1;
      if (res > k) return 0;
      printf("%lld\n", res);
    }
  }
  for (register int i = 10; i <= 15; ++i)
    for (register int j = 10; j <= 99; ++j) {
      register long long res = j * pow(10, i - 1) + pow(10, i - 1) - 1;
      if (res > k) return 0;
      printf("%lld\n", res);
    }
  return 0;
}
