#include <bits/stdc++.h>
using namespace std;
bool sum(long long int n) {
  int sum = 0;
  while (n) {
    int r = n % 10;
    sum += r;
    n /= 10;
  }
  return sum == 10 ? true : false;
}
int main() {
  int k, cnt = 0;
  cin >> k;
  long long int n = 1;
  while (1) {
    if (cnt == k - 1 && sum(n)) {
      cout << n;
      break;
    } else if (cnt != k - 1 && sum(n)) {
      ++cnt;
    }
    ++n;
  }
}
