#include <bits/stdc++.h>
using namespace std;
int sum(int n) {
  int ans = 0;
  while (n > 0) {
    ans += n % 10;
    n /= 10;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int k, x = 18, ans;
  cin >> k;
  while (k) {
    x++;
    if (sum(x) == 10) {
      ans = x;
      k--;
    }
  }
  cout << x << endl;
  return 0;
}
