#include <bits/stdc++.h>
using namespace std;
long long in() {
  long long a;
  scanf("%lld", &a);
  return a;
}
int main() {
  int k = in();
  long long x = 19;
  while (--k) {
    x += 9;
    long long bal = x;
    bool hoise = 1;
    while (hoise) {
      int sum = 0;
      bal = x;
      while (bal) {
        sum += (bal % 10);
        bal /= 10;
      }
      if (sum == 10)
        break;
      else
        x += 9;
    }
  }
  printf("%lld\n", x);
}
