#include <bits/stdc++.h>
using namespace std;
int s(int k) {
  int sum = 0;
  while (k > 0) {
    sum += k % 10;
    k /= 10;
  }
  if (sum == 10)
    return 1;
  else
    return (-1);
}
int main() {
  int a;
  cin >> a;
  int i = 1;
  int k = 19;
  while (i < a) {
    k += 9;
    if (s(k) == 1) i++;
  }
  cout << k;
  return 0;
}
