#include <bits/stdc++.h>
using namespace std;
const long long MAXn = 1e7 + 1e6;
const long long MXi = 10;
long long k, dp[MAXn];
bool ok(long long x) {
  long long cnt = 0;
  for (long long i = 0; i < MXi; ++i) {
    if (x > 0) {
      cnt += x % 10;
      x /= 10;
    } else
      break;
  }
  return cnt == 10;
}
long long doo() {
  long long ans = 0;
  for (long long i = 19; i < MAXn; ++i) {
    if (ok(i)) ans++;
    if (ans == k) return cout << i << endl, 0;
  }
}
signed main() {
  cin >> k;
  doo();
}
