#include <bits/stdc++.h>
using namespace std;
bool isPerfect(int n) {
  int sum = 0;
  while (n != 0) {
    sum = sum + (n % 10);
    n = n / 10;
  }
  if (sum == 10) {
    return true;
  }
  return false;
}
int main() {
  int a = 19, b, tmp = 1;
  cin >> b;
  while (tmp != b) {
    a += 9;
    if (isPerfect(a)) {
      tmp++;
      if (tmp == b) {
        break;
      }
    }
  }
  cout << a << endl;
}
