Drop the Bit
InterviewTime limit1sMemory limit1024 MB
Given N and the counts of 1 bits in two N-bit binary numbers x and y, find the maximum possible value of x XOR y.
Problem
Wrapper H.Arc, who plays with bits, came up with two -digit binary numbers and one day when composing was not going well. He then left a note:
In , digits are , and in , digits are . Both numbers may start with .
You found this note and wondered about the maximum value of over all pairs , that H.Arc could have come up with. Find this value.
Input
The first line contains .
The second line contains and , separated by a space.
Output
Print the maximum value of .
Hint
is the bitwise XOR operation. For two binary numbers , the -th digit of is if the -th digits of and are equal, and otherwise.