A legacy protocol transmits register fields of a configurable width b bits. Due to a wiring quirk on the receiving hardware, every field must be bit-mirrored (its bits reversed left-to-right) before use.
Given the field width b and a value n known to fit in b bits, write n as a b-bit binary string (padded with leading zeros to exactly b digits), reverse that string, and print the decimal value of the reversed string.
Input format
Line 1: an integer b, the field width in bits.
Line 2: an integer n.
Output format
A single integer: the decimal value obtained by reversing the b-bit binary representation of n.
Constraints
- 1 ≤ b ≤ 32
- 0 ≤ n < 2^b