#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll sum(ll n) {
  ll ans = 0;
  while (n) {
    ans += n % 10;
    n /= 10;
  }
  return ans;
}
void solveCP311() {
  ll n;
  cin >> n;
  ll k = 0;
  for (ll i = 19;; i++) {
    if (sum(i) == 10) {
      k++;
    }
    if (k == n) {
      cout << i;
      break;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll t = 1;
  while (t--) {
    solveCP311();
  }
  return 0;
}
