#include <bits/stdc++.h>
int k, tt, stk[15], ttop;
void dfs(int &now, int nowv, int top) {
  if (nowv > 10) return;
  if (nowv == 10) {
    ++now;
    if (now == k) {
      for (int i = 0; i < top; ++i) printf("%d", stk[i]);
      for (int i = top; i < ttop; ++i) printf("%d", 0);
      exit(0);
    }
    return;
  }
  if (top >= ttop) return;
  for (int i = 0; i < 10; ++i) {
    if (!top && !i) continue;
    stk[top] = i;
    dfs(now, nowv + i, top + 1);
  }
}
int main() {
  scanf("%d", &k);
  for (int i = 1; (ttop = i) <= 10; ++i) dfs(tt, 0, 0);
  return 0;
}

### 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>
int k, tt, stk[15], ttop;
void dfs(int &now, int nowv, int top) {
  if (nowv > 10) return;
  if (nowv == 10) {
    ++now;
    if (now == k) {
      for (int i = 0; i < top; ++i) printf("%d", stk[i]);
      for (int i = top; i < ttop; ++i) printf("%d", 0);
      exit(0);
    }
    return;
  }
  if (top >= ttop) return;
  for (int i = 0; i < 10; ++i) {
    if (!top && !i) continue;
    stk[top] = i;
    dfs(now, nowv + i, top + 1);
  }
}
int main() {
  scanf("%d", &k);
  for (int i = 1; (ttop = i) <= 10; ++i) dfs(tt, 0, 0);
  return 0;
}

```