#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  auto n = 19;
  auto t = 1;
  while (true) {
    auto temp = n;
    auto sum = 0;
    while (temp > 0) {
      auto a = temp % 10;
      temp = temp / 10;
      sum = sum + a;
    }
    if (sum == 10) {
      if (t == k) {
        break;
      } else {
        t++;
      }
    }
    n++;
  }
  cout << n << '\n';
}
