#include <bits/stdc++.h>
using namespace std;
int main() {
  long long k, count = 0, tmp;
  long long num, dig, sum = 0;
  cin >> k;
  for (int i = 0; i < k; i++) {
    count++;
    tmp = count;
    sum = 0;
    while (tmp) {
      dig = tmp % 10;
      sum = sum + dig;
      tmp /= 10;
    }
    if (count / sum >= 2) {
      i--;
      continue;
    } else
      cout << count << endl;
  }
}
