atcoder#ABC234C. [ABC234C] Happy New Year!

[ABC234C] Happy New Year!

Score : 300300 points

Problem Statement

Among the positive integers that consist of 00's and 22's when written in base 1010, find the KK-th smallest integer.

Constraints

  • KK is an integer between 11 and 101810^{18} (inclusive).

Input

Input is given from Standard Input in the following format:

KK

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 2.34e+22, for example, or unnecessary leading zeros such as 0523 are not allowed.

3
22

The positive integers that consist of 00's and 22's when written in base 1010 are 2,20,22,2,20,22,\dots in ascending order. The (K=)(K=) 33-rd of them, which is 2222, should be printed.

11
2022
923423423420220108
220022020000202020002022022000002020002222002200002022002200

Note that the exact value of the answer must be printed as an integer, even if it is big.