#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, INF = 1e8, mx = 2e5 + 5, mn = 100;
int testCase = 1, cas = 0;
long long SumOfDigit(long long n) {
  long long sum = 0;
  while (n) sum += (n % 10), n /= 10;
  return sum;
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0);
  long long a = 1;
  int k;
  cin >> k;
  while (1) {
    if (SumOfDigit(a) == 10) {
      ++cas;
      if (cas == k) {
        cout << a << endl;
        break;
      }
    }
    a++;
  }
  return 0;
}
