Your task is to find the -th non-negative binary palindrome.
A binary palindrome is a number that reads the same forwards and backwards in the binary numeral system. For example, the numbers , , , and are binary palindromes, whereas the numbers , , and are not.
The first line contains the integer: .
Output the -th non-negative binary palindrome modulo on a single line.
Example 1
Example 2
Example 3
Example 4
— i \le 10^5
— i \le 10^{18}