#include <bits/stdc++.h>
int main() {
  int n, count = 0, sum = 0, test;
  scanf("%d", &n);
  int num = 1;
  while (1) {
    test = num;
    sum = 0;
    while (test != 0) {
      sum = sum + test % 10;
      test = test / 10;
    }
    if (sum == 10) {
      count++;
      if (count == n) {
        printf("%d", num);
        return 0;
      }
    }
    num++;
  }
  return 0;
}
