#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long cnt = 0, ans = 0;
  for (long long i = 19;; i += 9) {
    if (cnt == n) break;
    long long s = 0, temp = i;
    while (temp) {
      s += (temp % 10);
      temp /= 10;
    }
    if (s == 10) ans = i, cnt++;
  }
  cout << ans << '\n';
  return 0;
}
