Problem6514-- ABC234 —— C - Happy New Year!

6514: ABC234 —— C - Happy New Year!

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

Among the positive integers that consist of $0$'s and $2$'s when written in base $10$, find the $K$-th smallest integer.

Input

Input is given from Standard Input in the following format:
$K$

Output

Print the answer as an integer.
Here, the exact value must be printed as an integer, even if it is big. Exponential notations such as $\text{2.34e+22}$, for example, or unnecessary leading zeros such as $\text{0523}$ are not allowed.

Constraints

$K$ is an integer between $1$ and $10^{18}$ (inclusive).

Sample 1 Input

3

Sample 1 Output

22

The positive integers that consist of $0$'s and $2$'s when written in base $10$ are $2,20,22,\dots$ in ascending order.

The $(K=)\ 3$-rd of them, which is $22$, should be printed.

Sample 2 Input

11

Sample 2 Output

2022

Sample 3 Input

923423423420220108

Sample 3 Output

220022020000202020002022022000002020002222002200002022002200

Source/Category