#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000000;
const long long mod = 1000000007;
template <class T, class It>
void readvector(vector<T>& __cur, It& __cnt) {
  for (It ind = 0; ind < __cnt; ind++) {
    cin >> __cur[ind];
  }
}
template <class T>
T lcm(T a, T b) {
  return abs(a * b) / __gcd(a, b);
}
bool check(long long n) {
  long long sum = 0;
  while (n != 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum == 10;
}
int main() {
  long long k;
  cin >> k;
  unsigned long long cnt = 19, current_num = 1;
  while (current_num != k) {
    cnt += 9;
    if (check(cnt)) {
      current_num++;
    }
  }
  cout << cnt;
  return 0;
}
