Your task is to determine the smallest binary palindrome that is greater than or equal to a given number .A binary palindrome is a number that appears the same when read from left to right and right to left in the binary numeral system. For example, the numbers , , , and are binary palindromes, whereas , , and are not.
The first line contains the integer .
Output a single line with the smallest binary palindrome that is greater than or equal to .
Example 1
Example 2
Example 3
40% of the test cases will have n \le 10^5
60% of the test cases will have n \le 10^{18}