#include <bits/stdc++.h>
using namespace std;
long long ans[10001];
bool ok(long long x) {
  int res = 0;
  while (x) {
    int tmp = x % 10;
    res += tmp;
    x /= 10;
  }
  if (res == 10)
    return true;
  else
    return false;
}
void solve() {
  int cnt = 1;
  for (int i = 10; i <= 1e17; i++) {
    if (ok(i)) ans[cnt++] = i;
    if (cnt > 10000) break;
  }
}
int main() {
  solve();
  int n;
  cin >> n;
  cout << ans[n] << endl;
  return 0;
}
