Last K Bits of an Integer

You are given an integer number n and another integer k. Your task is to find and output the last k bits of the given number n when represented in binary form.

Input

The first line contains a single integer n (1 ≤ n ≤ ).
The second line contains a single integer k (0 ≤ k ≤ 30).

Output

Output a single integer representing the last k bits of n in its binary representation.

Examples

Input
Output
100 4
0100
3 10
0000000011

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue