#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y = 0, a, b = 0, d, i = 20;
  cin >> x;
  bool c = 0;
  if (x == 1) {
    cout << 19 << endl;
    return 0;
  } else {
    for (i = 20; (y + 1) != x; i++) {
      b = 0;
      a = i;
      while (a != 0) {
        d = a % 10;
        b += d;
        a /= 10;
        if (b == 10 && a == 0) {
          y++;
        }
      }
    }
  }
  cout << i - 1 << endl;
  return 0;
}
