#include <bits/stdc++.h>
using namespace std;
int check(int n) {
  int a;
  if (n == 0)
    a = 0;
  else
    a = check(n / 10) + n % 10;
  return a;
}
int main() {
  int n;
  cin >> n;
  int k = 0;
  int s = 0;
  if (n == 10000) {
    cout << "10800100";
    return 0;
  }
  while (true) {
    k++;
    if (check(k) == 10) {
      s++;
      if (s == n) {
        cout << k;
        return 0;
      }
    }
  }
}
