Let us write the integer in binary notation and generate all its left cyclic shifts, moving the first digit to the end each time.
For example, if n = 11, in binary this is . Its cyclic shifts are , , , . The maximum value among all obtained numbers is 1110_2 = 14_{10}.
Find the maximum value that can be obtained from all left cyclic shifts of the binary representation of the given .
One integer (1 \leq n \leq 2 \cdot 10^9).
One integer .
Example 11