Aliens have finally visited Earth. They are like us in every way except how they write integers in binary. We store an integer in a computer as a 32-bit binary number. The aliens use 32 bits too, but they read those bits in a completely different order.
Given an unsigned 32-bit number written our way, work out how the aliens would write it. The conversion takes two steps.
Read the reversed binary number back as a positive, unsigned decimal the way we would, and that is the answer.
Say the numbers were 4 bits wide and you were given 4. In binary that is 01002, and flipped it becomes 00102. Read back as decimal, the answer is 2.
Each line contains a single integer to flip, written in Earth's representation. A line starting with -1 marks the end of the input.
For each integer given in Earth's representation, print the value the aliens read after flipping it, in decimal, one per line. Treat the input number as a 32-bit integer, reverse the order of its bits, then evaluate that 32-bit binary number as if it were still in Earth's representation and print the result.