A little girl loves problems on bitwise operations very much. Here's one of them.

You are given two integers *l* and *r*. Let's consider the values of <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/9b77fab607849cb208cd8aab633b62d894fc3358.png" style="max-width: 100.0%;max-height: 100.0%;"/> for all pairs of integers *a* and *b* (*l* ≤ *a* ≤ *b* ≤ *r*). Your task is to find the maximum value among all considered ones.

Expression <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/b364f2e04c665b78b924ec10666327a4ef4635bc.png" style="max-width: 100.0%;max-height: 100.0%;"/> means applying bitwise excluding or operation to integers *x* and *y*. The given operation exists in all modern programming languages, for example, in languages *C*++ and *Java* it is represented as "^", in *Pascal* — as "xor".
The single line contains space-separated integers *l* and *r* (1 ≤ *l* ≤ *r* ≤ 10<sup class="upper-index">18</sup>).

Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specifier.
import sys
from bisect import bisect_left,bisect_right
from collections import defaultdict as dd
from collections import deque
from functools import cache
from heapq import heappop,heappush,heapify
from itertools import permutations, accumulate
from math import lcm,gcd,sqrt,ceil,comb
toBin=lambda x:bin(x).replace("0b","")
inf=float("inf");DIRS=[[1,0],[-1,0],[0,1],[0,-1]];CHARS="abcdefghijklmnopqrstuvwxyz"
MOD=10**9+7;N=300010;fac=[1]*N;invfac=[1]*N #Fill out N to calculate combinations
for i in range(2,N):fac[i]=fac[i-1]*i%MOD
invfac[N-1]=pow(fac[N-1],MOD-2,MOD)
for i in range(N-1)[::-1]:invfac[i]=invfac[i+1]*(i+1)%MOD
def c(i,j):return 0 if i<j else fac[i]*invfac[j]*invfac[i-j]
input=sys.stdin.readline

def solve():
    """
    1011101 -> 1001
    0110101

    1 1 1
    1 0 1

    MSB just has to be XOR'd
    the lower bounded numbers cannot go from 1 to 0, bc that dips below the LB. Can only
    go from 0 to 1 if it doesn't go above the upper bound.
    Higher bounds can go either direction. as long as it doesnt go outside the boundaries.
    Compare bit by bit?
    1111
    Case 1: If MSB has 1 for upper number and 0 for lower number, it can be all 1s.
    Case 2: If MSB are both 1s:
            1   10  01
            1   10  10
            1&1:upper bound number can go from 1 to 0 If previously there was a 1-0.
                1   10  1100
                1   01  1000
            0&0:lower bound number can go from 0 to 1 if previous there was a 1-0.
                1   10  0
                1   01  0
    Maybe..if there even is a 1-0 pair, then everything can be 1s after...
    1101
    1011
    """
    l,r=map(int,input().split())
    lb=toBin(l);rb=toBin(r)
    i=0;res=""
    while i<len(rb):
        if (lb[i]=="0" and rb[i]=="1") or len(rb)>len(lb):break
        if lb[i]==rb[i]:res+="0"
        i+=1
    if i<len(rb):
        res+="1"*(len(rb)-i)
    print(int(res,2))



if __name__=="__main__":
    solve()