Digits 2, 3 and 6 are happy, while all others are unhappy. An integer is happy if it contains only happy digits in its decimal notation. For example, 2, 3, 263 are happy numbers, while 231 is not.
Now Cuber QQ wants to know the n-th happy positive integer.
Input
The first and only line of input contains a positive integer n ( 1≤n≤109).
Output
The first and only line of output contains the n-th happy positive integer.