#include <bits/stdc++.h>
using namespace std;
int diez(int x) {
  int x1 = 0;
  int s = 0;
  while (x != 0) {
    x1 = x % 10;
    x = x / 10;
    s += x1;
  }
  if (s == 10)
    return (1);
  else
    return (0);
}
int main() {
  int n;
  while (cin >> n) {
    int s = 18;
    int s1 = 0;
    while (n) {
      s++;
      if (diez(s) == 1) {
        s1 = s;
        n--;
      }
    }
    cout << s1 << endl;
  }
}
