407399: GYM102784 F Xorro the Xorman

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Xorro the Xormantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Erik forgot to make a costume for this year's Halloween festivities, which means he has to reuse his old Zorro outfit from last year. However, he doesn't want to be ridiculed by his friends for his laziness, so Erik rebrands himself as Xorro the Xorman. Instead of slashing a 'Z' on his enemies defeated in sword combat, Xorro will carve an 'X' onto whomever cannot answer his question involving the XOR bitwise operator. You meet the infamous Xorman while trick or treating, and are given two integers $$$A$$$ and $$$B$$$. Xorro wants you to tell him the maximum possible XOR of $$$A$$$ and $$$b$$$ for some integer $$$0 \leq b \leq B$$$. If you fail to answer correctly, Erik will strike in retaliation. Can you avoid the wrath of Xorro?

Input

The first and only line of input contains two integers $$$A$$$ and $$$B$$$ such that $$$0 \leq A, B \leq 10^{18}$$$.

Output

Output a single integer representing the answer to Xorro's query, the maximum possible value of $$$A \oplus b$$$.

ExamplesInput
5 4
Output
7
Input
7 32
Output
39

加入题单

上一题 下一题 算法标签: