#include <bits/stdc++.h>
int main() {
  int n, c = 19, s = 19, m = 0, i = 1;
  scanf("%d", &n);
  while (i < n) {
    c++;
    s = c;
    while (s) {
      m += s % 10;
      s /= 10;
    }
    if (m == 10) i++;
    m = 0;
  }
  printf("%d", c);
  return 0;
}
