#include <bits/stdc++.h>
using namespace std;
bool f(int x) {
  int a = x, sum = 0;
  while (a != 0) {
    sum += a % 10;
    a /= 10;
  }
  if (sum == 10) return true;
  return false;
}
int main() {
  int k, s, n;
  scanf("%d", &k);
  s = 19;
  n = 1;
  while (n < k) {
    s += 9;
    if (f(s)) n++;
  }
  printf("%d\n", s);
  return 0;
}
