Reverse the number
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
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 (1 ≤ n ≤ 30), the second line contains number x (1 ≤ x ≤ 10^9
).
Output
Print the reversed number x.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 895
Acceptance rate 59%