#include <bits/stdc++.h>
#define __SHI__ signed main()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define INF (int)1e18
#define vi vector<int>
#define vii vector<int,int>
#define MAXN (int)3e2 + 7
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FORR(i, a, b, c) for (int i = a; i <= b; i += c)
#define endl "\n"
#define file(name) if (fopen(name".inp", "r")) { freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
using namespace std;
int check(int k)
{
int s = 0;
while (k)
{
s += k % 10;
k /= 10;
}
return (s == 10);
}
__SHI__
{
fastio;
int n; cin >> n;
int d = 1;
for (int i = 19; ; i += 9)
{
if (!check(i)) continue;
if (d == n)
{
cout << i << endl;
return 0;
}
++d;
}
return 0;
}