Last K Bits of an Integer

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

Input

The first line contains a single integer (). The second line contains a single integer ().

Output

Output a single integer representing the last bits of the number 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