#include <bits/stdc++.h>
using namespace std;
int K;
void dfs(int len, int sum, int d_sum) {
  if (!K) return;
  if (len)
    for (int i = 0; i <= 10 - d_sum; ++i) dfs(len - 1, sum * 10 + i, d_sum + i);
  else if (d_sum == 10)
    if (--K == 0) printf("%d\n", sum);
}
void Dfs(int p) {
  for (int i = 1; i <= 9; ++i) dfs(p - 1, i, i);
  if (K) Dfs(p + 1);
}
int main() {
  scanf("%d", &K);
  Dfs(2);
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

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;
void dfs(int len, int sum, int d_sum) {
  if (!K) return;
  if (len)
    for (int i = 0; i <= 10 - d_sum; ++i) dfs(len - 1, sum * 10 + i, d_sum + i);
  else if (d_sum == 10)
    if (--K == 0) printf("%d\n", sum);
}
void Dfs(int p) {
  for (int i = 1; i <= 9; ++i) dfs(p - 1, i, i);
  if (K) Dfs(p + 1);
}
int main() {
  scanf("%d", &K);
  Dfs(2);
  return 0;
}

```