#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d = 1, a = 19, t;
  cin >> n;
  while (d < n) {
    a++;
    t = a;
    int sum = 0;
    while (t != 0) {
      sum += t % 10;
      t = t / 10;
    }
    if (sum == 10) {
      d++;
    }
  }
  cout << a << endl;
}
