#include <bits/stdc++.h>
using namespace std;
int n, m;
int ans[10005];
bool f(int x) {
  int flag = 0;
  while (x) {
    flag += x % 10;
    x /= 10;
  }
  return flag == 10;
}
void init() {
  int cnt = 1;
  int pos = 19;
  while (1) {
    if (f(pos)) ans[cnt++] = pos;
    pos++;
    if (cnt > 10000) break;
  }
}
int main() {
  ios::sync_with_stdio(false);
  init();
  int k;
  cin >> k;
  cout << ans[k] << endl;
  return 0;
}
