#include <bits/stdc++.h>
using namespace std;
int sod(int n) {
  int sum = 0;
  while (n) {
    sum += (n % 10);
    n /= 10;
  }
  return sum;
}
int main() {
  int n, i = 19, cnt = 0;
  cin >> n;
  while (1) {
    if (sod(i) == 10) {
      cnt++;
    }
    if (cnt == n) {
      cout << i;
      break;
    }
    i += 9;
  }
}
