#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.first == b.first)
    return a.second > b.second;
  else
    return a.first < b.first;
}
unsigned long long fact(unsigned long long n) {
  if (n == 1 || n == 0)
    return 1;
  else
    return n * fact(n - 1);
}
bool compp(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second > b.second;
}
vector<int> prime(20012, 1);
void preprocessing() {
  prime[0] = 0, prime[1] = 0;
  for (int i = 2; i * i <= 20012; i++) {
    if (prime[i] == 1) {
      for (int j = i * i; j <= 20012; j += i) {
        prime[j] = 0;
      }
    }
  }
  for (int i = 0; i < prime.size(); i++)
    if (prime[i] != 0) prime[i] = i;
  sort(prime.begin(), prime.end());
  vector<int>::iterator r;
  for (auto i = prime.begin(); i != prime.end(); ++i) {
    if (*(i + 1) != 0) {
      r = i + 1;
      break;
    }
  }
  prime.erase(prime.begin(), r);
}
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.first != b.first)
    return a.first > b.first;
  else
    return a.second < b.second;
}
string bin(int n) {
  string ans;
  while (n) {
    ans.append(to_string(n % 2));
    n /= 2;
  }
  reverse(ans.begin(), ans.end());
  return ans;
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (a % b == 0)
    return b;
  else
    return (gcd(b, a % b));
}
bool isten(unsigned long long n) {
  string s = to_string(n);
  int di = 0;
  for (int i = 0; i < s.size(); i++) di += s[i] - '0';
  if (di == 10)
    return true;
  else
    return false;
}
int main() {
  int k;
  cin >> k;
  unsigned long long sum = 19, t = 0;
  while (1) {
    if (isten(sum)) {
      t++;
      if (t < k)
        sum++;
      else
        break;
    } else
      sum++;
  }
  cout << sum;
  return 0;
}
