#include <bits/stdc++.h>
using namespace std;
int per(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main() {
  int i = 19, c = 0, k, xx;
  scanf("%d", &k);
  while (1) {
    if (per(i) == 10) {
      xx = i;
      c++;
    }
    i++;
    if (c == k) break;
  }
  printf("%d\n", xx);
}
