#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long MOD = 1e9 + 7;
double EPS = 1e-8;
int main() {
  int k;
  cin >> k;
  using P = pair<long long, long long>;
  priority_queue<P, vector<P>, greater<P> > q;
  q.push(make_pair(0, 0));
  set<long long> used, st;
  used.insert(0LL);
  while (!q.empty() && st.size() < 1e5 + 10) {
    auto p = q.top();
    q.pop();
    auto val = p.first, sum = p.second;
    if (sum == 10) st.insert(val);
    for (int i = (0); i < (int)(10); i++) {
      if (sum + i > 10) break;
      if (used.count(val * 10 + i)) continue;
      q.push(make_pair(val * 10 + i, sum + i));
      used.insert(val * 10 + i);
    }
  }
  vector<long long> v;
  for (auto& p : st) v.push_back(p);
  cout << v[k - 1] << endl;
  return 0;
}

### Prompt

Develop a solution in CPP to the problem described below:

We consider a positive integer perfect, if and only if the sum of its digits is exactly 10. Given a positive integer k, your task is to find the k-th smallest perfect positive integer.

Input

A single line with a positive integer k (1 ≤ k ≤ 10 000).

Output

A single number, denoting the k-th smallest perfect integer.

Examples

Input

1


Output

19


Input

2


Output

28

Note

The first perfect integer is 19 and the second one is 28.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long MOD = 1e9 + 7;
double EPS = 1e-8;
int main() {
  int k;
  cin >> k;
  using P = pair<long long, long long>;
  priority_queue<P, vector<P>, greater<P> > q;
  q.push(make_pair(0, 0));
  set<long long> used, st;
  used.insert(0LL);
  while (!q.empty() && st.size() < 1e5 + 10) {
    auto p = q.top();
    q.pop();
    auto val = p.first, sum = p.second;
    if (sum == 10) st.insert(val);
    for (int i = (0); i < (int)(10); i++) {
      if (sum + i > 10) break;
      if (used.count(val * 10 + i)) continue;
      q.push(make_pair(val * 10 + i, sum + i));
      used.insert(val * 10 + i);
    }
  }
  vector<long long> v;
  for (auto& p : st) v.push_back(p);
  cout << v[k - 1] << endl;
  return 0;
}

```