#include <bits/stdc++.h>
using namespace std;
int dp[10005];
int main() {
  int in = 0;
  for (int i = 19; i <= 10800100; i++) {
    int len = log10(i) + 1;
    int s = 0, t = i;
    for (int j = 1; j <= len; j++) {
      s += t % 10;
      t /= 10;
      if (s > 10) break;
    }
    if (s == 10) {
      in++;
      dp[in] = i;
    }
  }
  int k;
  cin >> k;
  cout << dp[k] << endl;
  return 0;
}
