#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 1000000 + 5;
const double PI = acos(-1.0);
const double E = 2.718281828459;
const double eps = 1e-7;
int T, n, num[100005];
int main() {
  long k, n = 19, x = 0, m;
  scanf("%ld", &k);
  while (k - 1 > 0) {
    x = 0;
    n++;
    m = n;
    while (m > 0) {
      x += m % 10;
      m /= 10;
    }
    if (x == 10) {
      k--;
    }
  }
  printf("%ld\n", n);
}
