529. Popcount Bits

0

Medium

Let's denote **pop_count(x)** as the number of bits set ('1' bits) in the binary representation of the non-negative integer ***x***. You are given a query consisting of pair of integers l and r. Find the x, such that l ≤ x ≤ r, and **pop_count(x)** is maximum possible. ***Note : If there are multiple such numbers find the smallest of them.***

Input Format

Single line contains two integers l and r .

Output Format

Print the answer in a separate line.

Example

Input

5 10

Output

7

Constraints

1 <= l,r <= 1018
Loading...

View Submissions

Console