#include <bits/stdc++.h>
using namespace std;
int sum(int digits) {
  int summation = 0;
  while (digits > 0) {
    int a = digits % 10;
    summation = summation + a;
    digits = digits / 10;
  }
  return (summation);
}
int main() {
  int k;
  cin >> k;
  int n = 19;
  int p;
  while (k) {
    if (sum(n) == 10) {
      p = n;
      k--;
    }
    n = n + 9;
  }
  cout << p;
}
