#include <bits/stdc++.h>
using namespace std;
bool is_perfect(long long n) {
  long long sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum == 10;
}
int main(void) {
  long long k;
  cin >> k;
  long long n = 0;
  while (k > 0) {
    n++;
    if (is_perfect(n)) {
      k--;
    }
  }
  cout << n << endl;
  return 0;
}
