#include <bits/stdc++.h>
using namespace std;
int mark[10800100], p;
void prft() {
  int nu, sum = 0;
  for (int i = 19; i <= 10800100; i++) {
    nu = i;
    sum = 0;
    while (nu != 0) {
      sum = sum + nu % 10;
      nu = nu / 10;
      if (sum > 10) break;
    }
    if (sum == 10) mark[p++] = i;
  }
}
int main() {
  int a, b, i, n, j, c = 0;
  scanf("%d", &n);
  prft();
  printf("%d ", mark[n - 1]);
  return 0;
}
