#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  int s = 0;
  int n = 0;
  while (k > 0) {
    s = 0;
    n++;
    int tmp = n;
    while (tmp > 0) {
      s += tmp % 10;
      tmp /= 10;
    }
    if (n / s == 1) {
      k--;
      cout << n << endl;
    }
  }
}
