#include <bits/stdc++.h>
using namespace std;
const int K_MAX = 10000;
int k;
bool input() {
  if (cin >> k) return true;
  return false;
}
int sum(int x) {
  int res = 0;
  while (x > 0) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
void solve() {
  int numbers[K_MAX];
  int n = 0;
  for (int i = 0; i < INT_MAX; ++i)
    if (sum(i) == 10) {
      numbers[n++] = i;
      if (n >= K_MAX) break;
    }
  cout << numbers[k - 1] << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  while (input()) {
    solve();
  }
  return 0;
}
