#include <bits/stdc++.h>
using namespace std;
int sum(long int c) {
  int somme = 0;
  while (c) {
    somme = somme + c % 10;
    c = c / 10;
  }
  return (somme);
}
int main() {
  long int k, c = 19;
  cin >> k;
  while (k) {
    if (sum(c) == 10) k--;
    c += 9;
  }
  cout << c - 9;
  return 0;
}
