#include <bits/stdc++.h>
using namespace std;
class PerfectNumber {
 public:
  unsigned int k;
  int perf;
  PerfectNumber();
  PerfectNumber(unsigned int);
  void operator=(const PerfectNumber&);
  unsigned int fastPow(unsigned int, unsigned int);
  bool verifyMaxTen(unsigned int);
};
PerfectNumber::PerfectNumber() : k(0) {}
void PerfectNumber::operator=(const PerfectNumber& right) { k = right.k; }
bool PerfectNumber::verifyMaxTen(unsigned int curr) {
  unsigned int acum = 0;
  for (int i = curr; i > 0; i /= 10) {
    acum += i % 10;
  }
  if (acum != 10)
    return false;
  else
    return true;
}
PerfectNumber::PerfectNumber(unsigned int num) {
  k = num;
  unsigned int curr = 19;
  unsigned int sum = 0, count = 0;
  while (count < k) {
    if (verifyMaxTen(curr)) count++;
    if (count < k) curr += 9;
  }
  perf = curr;
  cout << perf;
}
int main(int argc, char* argv[]) {
  PerfectNumber perfecton;
  unsigned int k;
  cin >> k;
  perfecton = PerfectNumber(k);
  return 0;
}
