#include <bits/stdc++.h>
int digit_sum(long long int n) {
  long long int a, b = 0, c, i = 0;
  c = n;
  while (n > 0) {
    a = n % 10;
    n /= 10;
    b += a;
  }
  if (b == 10)
    return 1;
  else
    return 0;
}
int main() {
  long long int i, k = 0, n;
  scanf("%lld", &n);
  for (i = 19;; i += 9) {
    if (1 == digit_sum(i)) k++;
    if (k == n) break;
  }
  printf("%lld\n", i);
}
