#include <bits/stdc++.h>
using namespace std;
double sunuke(long m) {
  char ch[16];
  int ii, len;
  int sum = 0;
  double sumd;
  sprintf(ch, "%ld", m);
  len = strlen(ch);
  for (ii = 0; ii < len; ii++) {
    sum += ch[ii] - '0';
  }
  sumd = sum;
  return m / sumd;
}
int main() {
  long ii, jj, k, cnt = 0;
  ;
  double ret;
  vector<double> sunukeNum;
  for (ii = 0; ii < 1000000; ii++) {
    sunukeNum.push_back(sunuke(ii));
  }
  cin >> k;
  for (ii = 1; ii < 1000000; ii++) {
    ret = sunukeNum[ii];
    for (jj = ii + 1; jj < 1000000; jj++) {
      if (ret > sunukeNum[jj]) {
        break;
      }
    }
    if (jj == 1000000) {
      cnt++;
      cout << ii << endl;
    }
    if (cnt == k) {
      break;
    }
  }
  return 0;
}
