B. Bonfim Bits
time limit per test
0.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

During a cultural fair at UFBA, a group of students is preparing souvenir ribbons inspired by the famous fitinhas do Bonfim. Each ribbon design is encoded by an integer, and its binary representation tells which ornaments are present: a bit equal to $$$1$$$ means that ornament is used, while a bit equal to $$$0$$$ means it is not. Therefore, the total number of ornaments in a design is exactly the number of bits set to $$$1$$$.

Professor Rubis wants to approve the next design after a given code $$$N$$$, but he is strict about one detail: the new design must contain exactly $$$M$$$ ornaments. Among all valid integers strictly greater than $$$N$$$, he wants the smallest possible one, so that the next approved design is as close as possible to the current code.

Help him find that next ribbon code.

Input

The input contains two integers $$$N$$$ and $$$M$$$ ($$$0 \leq N \leq 10^{18}$$$, $$$1 \leq M \leq 60$$$).

Output

Output the code of the next approved ribbon design.

Examples
Input
10 2
Output
12
Input
7 1
Output
8
Input
13 3
Output
14
Note