#include <bits/stdc++.h>
using namespace std;
int n, s = 19, i, sum, j, l;
int main() {
  cin >> n;
  for (i = 1; i < n; i++) {
    s += 9;
    l = s;
    while (l) {
      sum += (l % 10);
      l /= 10;
    }
    if (sum != 10) i--;
    sum = 0;
  }
  cout << s;
}
