#include <bits/stdc++.h>
using namespace std;
int K, a[100], sum;
void dfs(int k, int now, int ret) {
  if (now == k + 1) {
    ++sum;
    return;
  }
  for (int i = max((now == 1) ? 1 : 0, ret - 9 * (k - now));
       i < min(ret + 1, 10); ++i) {
    a[now] = i;
    dfs(k, now + 1, ret - i);
    if (sum >= K) return;
  }
}
int main() {
  scanf("%d", &K);
  int i = 2;
  for (; sum < K; ++i) dfs(i, 1, 10);
  for (int j = 1; j < i; ++j) printf("%d", a[j]);
  cout << endl;
}

### Prompt

Create a solution in Cpp for the following problem:

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;
int K, a[100], sum;
void dfs(int k, int now, int ret) {
  if (now == k + 1) {
    ++sum;
    return;
  }
  for (int i = max((now == 1) ? 1 : 0, ret - 9 * (k - now));
       i < min(ret + 1, 10); ++i) {
    a[now] = i;
    dfs(k, now + 1, ret - i);
    if (sum >= K) return;
  }
}
int main() {
  scanf("%d", &K);
  int i = 2;
  for (; sum < K; ++i) dfs(i, 1, 10);
  for (int j = 1; j < i; ++j) printf("%d", a[j]);
  cout << endl;
}

```