#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll a, b, c, d = 0, e = 0, n;
  cin >> a;
  n = a;
  for (ll i = 0; i < 1e18; i++) {
    e = 0;
    b = i;
    while (b) {
      e = e + b % 10;
      b = b / 10;
    }
    if (e == 10) a = a - 1;
    if (a == 0) {
      cout << i;
      return 0;
    }
  }
  return 0;
}
