A number written in the obsolete Gould floating-point format has to be converted to the IEEE 754 single-precision format as accurately as possible.
The Gould format is 32 bits.

It has one sign bit, 7 exponent bits and 24 mantissa bits, and those 32 bits are written as 8 hexadecimal digits. Up to the first three bits of the mantissa may be 0. The value the format holds is
value=(−1)S×16EXP−64×224MANTISSA
S is the sign bit, EXP is the exponent field, and MANTISSA is the mantissa field. Zero is written as 32 zero bits.
The IEEE 754 single-precision format is also 32 bits.

It has one sign bit, 8 exponent bits and a 24 bit significand. In a normalized number the leading bit of the significand is always 1, so that bit is not stored and the mantissa field is written with 23 bits.
If the exponent field is neither 0 nor 255, the number is normalized and its value is
value=(−1)S×2EXP−127×(1+223MANTISSA)
If the exponent field is 255 and the mantissa field is 0, the number is positive infinity or negative infinity. The sign bit decides which one.
If the exponent field is 255 and the mantissa field is not 0, the number is not a number, and this problem does not deal with it.
If the exponent field is 0 and the mantissa field is 0, the number is +0 or -0. The sign bit tells the two apart.
If the exponent field is 0 and the mantissa field is not 0, the number is subnormal and its value is
value=(−1)S×2−126×223MANTISSA
Given a number written in the Gould format, convert it by these rules.
When the significand is moved over, pad the missing low places with 0 if there are not enough bits, and drop the leftover low bits if there are too many. Do not round.
The first line has the number of test cases P. (1≤P≤1000)
Each of the next P lines has the number of the test case and one number written in the Gould format, separated by a space. That number is 8 hexadecimal digits made only of the digits 0 to 9 and the uppercase letters A to F.
For each test case, print the number of the test case and the converted IEEE value on one line, separated by a space. Write the IEEE value as 8 uppercase hexadecimal digits.