#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5 + 5;
const long long oo = 1e15;
const long long MOD = 1e9 + 7;
const int base = 311;
long long TestCase;
long long n, s, digit;
void Solve() {
  for (long long i = (long long)19; i <= (long long)1e18; i += (long long)9) {
    digit = i;
    s = 0;
    while (digit) s += digit % 10, digit /= 10;
    if (s == 10) n--;
    if (!n) {
      cout << i;
      exit(0);
    }
  }
}
void Input() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  TestCase = 1;
  cin >> n;
}
int main() {
  Input();
  while (TestCase--) Solve();
}
