#include <bits/stdc++.h>
using namespace std;
void read(bool out = 0) {}
bool isper(long long x) {
  long long sum = 0;
  while (x) {
    sum += x % 10;
    x /= 10;
  }
  if (sum == 10) return 1;
  return 0;
}
int main() {
  long long ans = 0;
  long long k;
  cin >> k;
  for (long long i = 0;; i++) {
    if (isper(i)) ans++;
    {
      if (ans == k) return cout << i, 0;
    }
  }
  cout << ans;
}
