e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Reverse the number

Reverse the number

Last week the students in the evening ate kefir and ropes, but at yesterday's planning meeting the teachers decided that the ropes are not good, so today with kefir the students will get the numbers (the same ones that arifmetyane dig in a galaxy far far away). You need only to fry them a little (numbers of course). Assistant of the chief cook Clara fries n-bit number x. Clara already fried it on one side, but the second side is still slightly damp. Your task is to turn the number to another side. Reverse the number means to change the first bit with the last, the second - with the penultimate and so on.

Input

The first line contains number n (1n30), the second line contains number x (1x109).

Output

Print the reversed number x.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3
6
Output example #1
3
Input example #2
4
1
Output example #2
8