#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  scanf("%d", &k);
  int count = 0;
  for (int i = 1; i < 1000000000; i++) {
    int p = i;
    int ans = 0;
    while (p) {
      ans += p % 10;
      p /= 10;
    }
    if (ans == 10) {
      count++;
    }
    if (count == k) {
      printf("%d\n", i);
      return 0;
    }
  }
}
