#include <bits/stdc++.h>
using namespace std;
int num[10000005];
int sum(int n) {
  int s = 0;
  while (n) {
    s += n % 10;
    n = n / 10;
  }
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int k;
  int kk = 1;
  cin >> k;
  int ans;
  for (int i = 19; i < 1000000000; i++) {
    if (sum(i) == 10) {
      if (kk == k) {
        ans = i;
        break;
      }
      kk++;
    }
  }
  cout << ans << endl;
  return 0;
}
