Bitwise Equations#1550

Bitwise Equations

1 second
64 megabytes
Very easy

You are given two positive integers and . Find the -th smallest positive integer (where is -based) such that the following equation holds:

x + y = x \mid y

where '' denotes the bitwise OR operator.

Input

Each line contains two integers and (1 \leq x,\ k \leq 2 \times 10^9). Each line represents a separate test case.

Output

For each test case, print the -th smallest positive integer (in a separate line) that satisfies the equation above.

Examples

Example 1

Loading
Loading