#include <bits/stdc++.h>
using namespace std;
vector<string> v;
void findNDigitNumsUtil(int n, int sum, char* out, int index) {
  if (index > n || sum < 0) return;
  if (index == n) {
    if (sum == 0) {
      out[index] = '\0';
      v.push_back(out);
    }
    return;
  }
  for (int i = 0; i <= 9; i++) {
    out[index] = i + '0';
    findNDigitNumsUtil(n, sum - i, out, index + 1);
  }
}
void findNDigitNums(int n, int sum) {
  char out[n + 1];
  for (int i = 1; i <= 9; i++) {
    out[0] = i + '0';
    findNDigitNumsUtil(n, sum - i, out, 1);
  }
}
int main() {
  int n;
  cin >> n;
  int sum = 10;
  for (int i = 2; i <= 10; i++) {
    findNDigitNums(i, sum);
  }
  for (int i = 0; i < v.size(); i++) {
    if (i == n - 1) {
      cout << v[i];
      break;
    }
  }
  return 0;
}

### Prompt

Please create a solution in Cpp to 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;
vector<string> v;
void findNDigitNumsUtil(int n, int sum, char* out, int index) {
  if (index > n || sum < 0) return;
  if (index == n) {
    if (sum == 0) {
      out[index] = '\0';
      v.push_back(out);
    }
    return;
  }
  for (int i = 0; i <= 9; i++) {
    out[index] = i + '0';
    findNDigitNumsUtil(n, sum - i, out, index + 1);
  }
}
void findNDigitNums(int n, int sum) {
  char out[n + 1];
  for (int i = 1; i <= 9; i++) {
    out[0] = i + '0';
    findNDigitNumsUtil(n, sum - i, out, 1);
  }
}
int main() {
  int n;
  cin >> n;
  int sum = 10;
  for (int i = 2; i <= 10; i++) {
    findNDigitNums(i, sum);
  }
  for (int i = 0; i < v.size(); i++) {
    if (i == n - 1) {
      cout << v[i];
      break;
    }
  }
  return 0;
}

```