#include <bits/stdc++.h>
using namespace std;
bool sortinrev(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.first > b.first);
}
float sum(int a) {
  float res = 0.00;
  while (a != 0) {
    res += a % 10;
    a /= 10;
  }
  return res;
}
int main() {
  int k;
  cin >> k;
  for (int i = 1; i <= k; i++) {
    int flag = 1;
    for (int j = i + 1; j <= i + 1000; j++) {
      if (i / sum(i) > j / sum(j)) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) cout << i << '\n';
  }
}
