#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
bool sum(int n) {
  int s = 0;
  while (n != 0) {
    s += (n % 10);
    n /= 10;
  }
  if (s == 10)
    return true;
  else
    return false;
}
void solve() {
  int k;
  cin >> k;
  int n = 19;
  while (k) {
    if (sum(n)) k--;
    n++;
  }
  cout << n - 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
}
