#include <bits/stdc++.h>
int main() {
  long long int t, m, n = 19, l = 0, k = 1;
  scanf("%lli", &t);
  while (k != t) {
    n += 9;
    m = n;
    while (m != 0) {
      l += m % 10;
      m = m / 10;
    }
    if (l == 10) {
      k++;
    }
    l = 0;
  }
  printf("%lli", n);
  return 0;
}
