#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int fx[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int fy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int TLx[] = {0, -1, -1, 0};
int TLy[] = {-1, -1, 0, 0};
int TRx[] = {-1, -1, 0, 0};
int TRy[] = {0, 1, 1, 0};
int BLx[] = {0, 1, 1, 0};
int BLy[] = {-1, -1, 0, 0};
int BRx[] = {0, 1, 1, 0};
int BRy[] = {1, 1, 0, 0};
vector<int> per;
void make() {
  for (int i = 19; i <= 11000000; i++) {
    int s = 0;
    int x = i;
    while (x != 0) {
      s += x % 10;
      x /= 10;
    }
    if (s == 10) per.push_back(i);
  }
}
int main() {
  make();
  int n;
  cin >> n;
  cout << per[n - 1] << endl;
  return 0;
}
