#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
vector<long long int> ans;
bool prime(long long int s) {
  if (s <= 1) return false;
  if (s <= 3) return true;
  if (s % 2 == 0 || s % 3 == 0) return false;
  for (long long int i = 5; i * i <= s; i = i + 6)
    if (s % i == 0 || s % (i + 2) == 0) return false;
  return true;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool square(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
const long long int sz = 1e6;
long long int pp[sz + 1];
void sieve() {
  for (long long int i = 0; i <= sz; ++i) pp[i] = 1;
  pp[0] = pp[1] = 0;
  for (long long int i = 2; i * i <= sz; ++i) {
    if (pp[i]) {
      for (long long int j = i * i; j <= sz; j += i) pp[j] = 0;
    }
  }
}
bool sum(long long int n) {
  long long int res = 0;
  while (n) {
    res = res + n % 10;
    n /= 10;
  }
  if (res == 10)
    return true;
  else
    return false;
}
void solve() {
  long long int x;
  cin >> x;
  long long int num = 19;
  while (x) {
    if (sum(num)) x--;
    num++;
  }
  num--;
  cout << num;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
