Write a program that converts a number written in one base into the same number written in another base. There are 62 possible digits:
{ 0-9, A-Z, a-z }
Hint: if you chain base conversions, feeding the output of one conversion in as the input to the next, then when you return to the original base you should recover the original number.
The first line contains a single positive integer: the number of lines that follow.
Each following line contains a (decimal) input base, a (decimal) output base, and a number written in the input base, separated by spaces. Both the input base and the output base are in the range from 2 to 62.
The digit values are: 0–9 have their usual meanings 0 through 9, and A = 10, B = 11, …, Z = 35, a = 36, b = 37, …, z = 61.
For each base conversion, print three lines.