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, threading
import math
from os import path
from collections import deque, defaultdict, Counter
from bisect import *
from string import ascii_lowercase
from functools import cmp_to_key
from random import randint
import heapq
 
 
def readInts():
    x = list(map(int, (sys.stdin.readline().rstrip().split())))
    return x[0] if len(x) == 1 else x
 
 
def readList(type=int):
    x = sys.stdin.readline()
    x = list(map(type, x.rstrip('\n\r').split()))
    return x
 
 
def readStr():
    x = sys.stdin.readline().rstrip('\r\n')
    return x
 
 
write = sys.stdout.write
read = sys.stdin.readline
 
 
MAXN = 1123456


class mydict:
    def __init__(self, func=lambda: 0):
        self.random = randint(0, 1 << 32)
        self.default = func
        self.dict = {}
 
    def __getitem__(self, key):
        mykey = self.random ^ key
        if mykey not in self.dict:
            self.dict[mykey] = self.default()
        return self.dict[mykey]
 
    def get(self, key, default):
        mykey = self.random ^ key
        if mykey not in self.dict:
            return default
        return self.dict[mykey]
 
    def __setitem__(self, key, item):
        mykey = self.random ^ key
        self.dict[mykey] = item
 
    def getkeys(self):
        return [self.random ^ i for i in self.dict]
 
    def __str__(self):
        return f'{[(self.random ^ i, self.dict[i]) for i in self.dict]}'

 
def lcm(a, b):
    return (a*b)//(math.gcd(a,b))
 
 
def mod(n):
    return n%(1000000007) 


def solve(t):
    # print(f'Case #{t}: ', end = '')
    l, r = readInts()
    bitl = [0 for _ in range(64)]
    bitr = bitl.copy()
    k = 0
    lc = l
    rc = r
    while lc > 0:

        if lc&1:
            bitl[k] = 1
        
        lc >>= 1
        k += 1

    k = 0
    while rc > 0:

        if rc&1:
            bitr[k] = 1
        
        rc >>= 1
        k += 1

    curl = l
    curr = r
    for i in range(63, -1, -1):
        if bitl[i] == bitr[i]:
            if bitl[i] == 0:
                # print(i, curl+(1<<i), r, curl)
                if curl + (1<<i) <= r:
                    curl += 1<<i

                elif curr + (1<<i) <= r:
                    curr += 1<<i

            elif bitl[i] == 1:
                if curr - (1<<i) >= l:
                    curr -= 1<<i

                elif curl - (1<<i) >= l:
                    curl -= 1<<i

    # print(bitl[:6])
    # print(bitr[:6])
    # print(curl, curr)

    print(curl^curr)


def main():
    t = 1
    if path.exists("/Users/arijitbhaumik/Library/Application Support/Sublime Text/Packages/User/input.txt"):
        sys.stdin = open("/Users/arijitbhaumik/Library/Application Support/Sublime Text/Packages/User/input.txt", 'r')
        sys.stdout = open("/Users/arijitbhaumik/Library/Application Support/Sublime Text/Packages/User/output.txt", 'w')
    # sys.setrecursionlimit(100000) 
    # t = readInts()
    for i in range(t):
        solve(i+1)
 
 
if __name__ == '__main__':
    main()  