#include <bits/stdc++.h>
using namespace std;
const int maxn = 10005;
using namespace std;
int cnt = 0;
int b[maxn];
void panduan(int N) {
  for (long long i = 18;; i++) {
    long long sum = 0;
    long long d = i;
    long long c;
    while (d != 0) {
      c = d % 10;
      sum = sum + c;
      d = d / 10;
    }
    if (sum == 10) {
      b[cnt++] = i;
    }
    if (cnt == N) break;
  }
}
int main() {
  int N;
  cin >> N;
  panduan(N);
  printf("%d\n", b[N - 1]);
}
